Merge branch 'develop' into feature/move-to-selector
This commit is contained in:
commit
26891975d8
@ -23,7 +23,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.Core.Common", "common\A
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.Migration.Creator", "common\Tools\ASC.Migration.Creator\ASC.Migration.Creator.csproj", "{4BECDA03-E5E7-4273-B2D5-65AD3B1D0AF6}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.Migration.Core", "common\Tools\ASC.Migration.Core\ASC.Migration.Core.csproj", "{4E971C04-8D1F-4C07-8D6F-C062C114CF7F}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.Migrations.Core", "common\Tools\ASC.Migrations.Core\ASC.Migrations.Core.csproj", "{4E971C04-8D1F-4C07-8D6F-C062C114CF7F}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.Migration.Runner", "common\Tools\ASC.Migration.Runner\ASC.Migration.Runner.csproj", "{249DC522-AC3B-475C-B77E-52CE0322E686}"
|
||||
EndProject
|
||||
|
@ -135,10 +135,10 @@ public class StorageFactory
|
||||
_coreBaseSettings = coreBaseSettings;
|
||||
}
|
||||
|
||||
public async Task<IDataStore> GetStorageAsync(int? tenant, string module, string region = "current")
|
||||
public async Task<IDataStore> GetStorageAsync(int tenant, string module, string region = "current")
|
||||
{
|
||||
var tenantQuotaController = _serviceProvider.GetService<TenantQuotaController>();
|
||||
tenantQuotaController.Init(tenant.GetValueOrDefault());
|
||||
tenantQuotaController.Init(tenant);
|
||||
|
||||
return await GetStorageAsync(tenant, module, tenantQuotaController, region);
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ public class IPRestriction : IpRestrictionBase, IMapFrom<TenantIpRestrictions>
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public int Tenant { get; set; }
|
||||
public int TenantId { get; set; }
|
||||
}
|
||||
|
||||
public class IpRestrictionBase
|
||||
|
@ -7,27 +7,27 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<NoWarn>1701;1702;EF1001</NoWarn>
|
||||
<PropertyGroup>
|
||||
<NoWarn>1701;1702;EF1001</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommandLineParser" Version="2.9.1" />
|
||||
<PackageReference Include="Microsoft.Build" Version="17.4.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\migrations\mysql\ASC.Migrations.MySql.csproj" />
|
||||
<ProjectReference Include="..\..\..\migrations\postgre\ASC.Migrations.PostgreSql.csproj" />
|
||||
<ProjectReference Include="..\..\..\products\ASC.Files\Core\ASC.Files.Core.csproj" />
|
||||
<ProjectReference Include="..\..\ASC.ActiveDirectory\ASC.ActiveDirectory.csproj" />
|
||||
<ProjectReference Include="..\..\ASC.Core.Common\ASC.Core.Common.csproj" />
|
||||
<ProjectReference Include="..\..\ASC.Data.Backup.Core\ASC.Data.Backup.Core.csproj" />
|
||||
<ProjectReference Include="..\ASC.Migration.Core\ASC.Migration.Core.csproj" />
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\migrations\mysql\ASC.Migrations.MySql.csproj" />
|
||||
<ProjectReference Include="..\..\..\migrations\postgre\ASC.Migrations.PostgreSql.csproj" />
|
||||
<ProjectReference Include="..\..\..\products\ASC.Files\Core\ASC.Files.Core.csproj" />
|
||||
<ProjectReference Include="..\..\ASC.ActiveDirectory\ASC.ActiveDirectory.csproj" />
|
||||
<ProjectReference Include="..\..\ASC.Core.Common\ASC.Core.Common.csproj" />
|
||||
<ProjectReference Include="..\..\ASC.Data.Backup.Core\ASC.Data.Backup.Core.csproj" />
|
||||
<ProjectReference Include="..\ASC.Migrations.Core\ASC.Migrations.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -26,21 +26,14 @@
|
||||
|
||||
global using ASC.Common.Logging;
|
||||
global using ASC.Core.Common.EF;
|
||||
global using ASC.Core.Common.EF.Context;
|
||||
global using ASC.Core.Common.EF.Teamlabsite;
|
||||
global using ASC.Core.Common.EF.Teamlabsite.Context;
|
||||
global using ASC.Core.Common.Hosting;
|
||||
global using ASC.Data.Backup.EF.Context;
|
||||
global using ASC.EventBus.Extensions.Logger;
|
||||
global using ASC.Feed.Context;
|
||||
global using ASC.Files.Core.EF;
|
||||
global using ASC.MessagingSystem.EF.Context;
|
||||
global using ASC.Webhooks.Core.EF.Context;
|
||||
|
||||
global using Microsoft.Extensions.Hosting.WindowsServices;
|
||||
|
||||
global using Migration.Core.Models;
|
||||
global using Migration.Core.Utils;
|
||||
global using ASC.Migrations.Core.Models;
|
||||
global using ASC.Migrations.Core.Utils;
|
||||
global using Migration.Creator;
|
||||
global using ASC.Migrations.Core;
|
||||
global using ASC.Migrations;
|
||||
|
||||
global using DbContextActivator = Migration.Core.Utils.DbContextActivator;
|
||||
global using DbContextActivator = ASC.Migrations.Core.Utils.DbContextActivator;
|
||||
|
@ -24,8 +24,6 @@
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
using ASC.Migration.Core;
|
||||
|
||||
namespace Migration.Creator;
|
||||
|
||||
public class MigrationCreator
|
||||
|
@ -24,8 +24,6 @@
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
using ASC.Migration.Core;
|
||||
|
||||
var options = new WebApplicationOptions
|
||||
{
|
||||
Args = args,
|
||||
|
@ -7,27 +7,27 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<NoWarn>1701;1702;EF1001</NoWarn>
|
||||
<PropertyGroup>
|
||||
<NoWarn>1701;1702;EF1001</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommandLineParser" Version="2.9.1" />
|
||||
<PackageReference Include="Microsoft.Build" Version="17.4.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\migrations\mysql\ASC.Migrations.MySql.csproj" />
|
||||
<ProjectReference Include="..\..\..\migrations\postgre\ASC.Migrations.PostgreSql.csproj" />
|
||||
<ProjectReference Include="..\..\..\products\ASC.Files\Core\ASC.Files.Core.csproj" />
|
||||
<ProjectReference Include="..\..\ASC.ActiveDirectory\ASC.ActiveDirectory.csproj" />
|
||||
<ProjectReference Include="..\..\ASC.Core.Common\ASC.Core.Common.csproj" />
|
||||
<ProjectReference Include="..\..\ASC.Data.Backup.Core\ASC.Data.Backup.Core.csproj" />
|
||||
<ProjectReference Include="..\ASC.Migration.Core\ASC.Migration.Core.csproj" />
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\migrations\mysql\ASC.Migrations.MySql.csproj" />
|
||||
<ProjectReference Include="..\..\..\migrations\postgre\ASC.Migrations.PostgreSql.csproj" />
|
||||
<ProjectReference Include="..\..\..\products\ASC.Files\Core\ASC.Files.Core.csproj" />
|
||||
<ProjectReference Include="..\..\ASC.ActiveDirectory\ASC.ActiveDirectory.csproj" />
|
||||
<ProjectReference Include="..\..\ASC.Core.Common\ASC.Core.Common.csproj" />
|
||||
<ProjectReference Include="..\..\ASC.Data.Backup.Core\ASC.Data.Backup.Core.csproj" />
|
||||
<ProjectReference Include="..\ASC.Migrations.Core\ASC.Migrations.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -24,26 +24,15 @@
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
global using System.Reflection;
|
||||
|
||||
global using ASC.Common.Logging;
|
||||
global using ASC.Core.Common.EF;
|
||||
global using ASC.Core.Common.EF.Context;
|
||||
global using ASC.Core.Common.EF.Teamlabsite;
|
||||
global using ASC.Core.Common.EF.Teamlabsite.Context;
|
||||
global using ASC.Core.Common.Hosting;
|
||||
global using ASC.Data.Backup.EF.Context;
|
||||
global using ASC.EventBus.Extensions.Logger;
|
||||
global using ASC.Feed.Context;
|
||||
global using ASC.Files.Core.EF;
|
||||
global using ASC.MessagingSystem.EF.Context;
|
||||
global using ASC.Webhooks.Core.EF.Context;
|
||||
|
||||
global using Microsoft.EntityFrameworkCore;
|
||||
global using Microsoft.EntityFrameworkCore;
|
||||
global using Microsoft.Extensions.Hosting.WindowsServices;
|
||||
|
||||
global using Migration.Core.Models;
|
||||
global using Migration.Core.Utils;
|
||||
global using ASC.Migrations.Core.Models;
|
||||
global using ASC.Migrations.Core.Utils;
|
||||
global using Migration.Runner;
|
||||
global using ASC.Migrations.Core;
|
||||
|
||||
global using DbContextActivator = Migration.Core.Utils.DbContextActivator;
|
||||
global using DbContextActivator = ASC.Migrations.Core.Utils.DbContextActivator;
|
||||
|
@ -24,8 +24,6 @@
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
using ASC.Migration.Core;
|
||||
|
||||
namespace Migration.Runner;
|
||||
|
||||
public class MigrationRunner
|
||||
|
@ -24,8 +24,6 @@
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
using ASC.Migration.Core;
|
||||
|
||||
var options = new WebApplicationOptions
|
||||
{
|
||||
Args = args,
|
||||
|
@ -35,7 +35,7 @@
|
||||
<ProjectReference Include="..\..\ASC.Common\ASC.Common.csproj" />
|
||||
<ProjectReference Include="..\..\ASC.Core.Common\ASC.Core.Common.csproj" />
|
||||
<ProjectReference Include="..\..\ASC.Data.Backup.Core\ASC.Data.Backup.Core.csproj" />
|
||||
<ProjectReference Include="..\ASC.Migration.Core\ASC.Migration.Core.csproj" />
|
||||
<ProjectReference Include="..\ASC.Migrations.Core\ASC.Migrations.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -24,7 +24,7 @@
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
namespace Migration;
|
||||
namespace ASC.Migrations;
|
||||
|
||||
public class AssemblyContextFinder : ContextFinder
|
||||
{
|
@ -24,10 +24,10 @@
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
namespace Migration;
|
||||
namespace ASC.Migrations;
|
||||
public abstract class ContextFinder
|
||||
{
|
||||
private readonly Type _baseType = typeof(DbContext);
|
||||
private readonly Type _baseType = typeof(DbContext);
|
||||
|
||||
public IEnumerable<Type> GetDependetContextsTypes()
|
||||
{
|
@ -24,12 +24,12 @@
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
namespace Migration;
|
||||
namespace ASC.Migrations;
|
||||
|
||||
public class MigrationGenerator
|
||||
{
|
||||
private readonly DbContext _dbContext;
|
||||
private readonly string _providerInfoProjectPath;
|
||||
private readonly DbContext _dbContext;
|
||||
private readonly string _providerInfoProjectPath;
|
||||
private readonly string _typeName;
|
||||
private readonly Regex _pattern = new Regex(@"\d+$", RegexOptions.Compiled);
|
||||
private readonly string _providerName;
|
||||
@ -44,8 +44,8 @@ public class MigrationGenerator
|
||||
|
||||
public MigrationGenerator(DbContext context, Provider provider, string providerInfoProjectPath)
|
||||
{
|
||||
_dbContext = context;
|
||||
_providerInfoProjectPath = providerInfoProjectPath;
|
||||
_dbContext = context;
|
||||
_providerInfoProjectPath = providerInfoProjectPath;
|
||||
_typeName = _dbContext.GetType().Name;
|
||||
_providerName = provider.ToString();
|
||||
}
|
@ -24,7 +24,7 @@
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
namespace Migration;
|
||||
namespace ASC.Migrations;
|
||||
|
||||
public class ModelDifferenceChecker
|
||||
{
|
@ -24,7 +24,7 @@
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
namespace Migration;
|
||||
namespace ASC.Migrations;
|
||||
|
||||
public class ProjectInfoContextFinder : ContextFinder
|
||||
{
|
||||
@ -35,15 +35,15 @@ public class ProjectInfoContextFinder : ContextFinder
|
||||
}
|
||||
|
||||
protected override Type[] GetAssemblyTypes()
|
||||
{
|
||||
try
|
||||
{
|
||||
var coreContextAssembly = Assembly.Load(_projectInfo.AssemblyName);
|
||||
return coreContextAssembly.GetTypes();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return Array.Empty<Type>();
|
||||
{
|
||||
try
|
||||
{
|
||||
var coreContextAssembly = Assembly.Load(_projectInfo.AssemblyName);
|
||||
return coreContextAssembly.GetTypes();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return Array.Empty<Type>();
|
||||
}
|
||||
}
|
||||
}
|
@ -24,7 +24,7 @@
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
namespace Migration;
|
||||
namespace ASC.Migrations;
|
||||
|
||||
public static class Solution
|
||||
{
|
||||
@ -34,7 +34,7 @@ public static class Solution
|
||||
var currentAssembly = Assembly.GetExecutingAssembly().GetName().Name;
|
||||
|
||||
return source.ProjectsInOrder
|
||||
.Where(p =>
|
||||
.Where(p =>
|
||||
p.ProjectType == SolutionProjectType.KnownToBeMSBuildFormat
|
||||
&& p.ProjectName != currentAssembly)
|
||||
.Select(p => new ProjectInfo
|
||||
@ -42,7 +42,7 @@ public static class Solution
|
||||
AssemblyName = p.ProjectName,
|
||||
Path = p.AbsolutePath.Replace($"{p.ProjectName}.csproj", string.Empty)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetProviderProjectPath(string solutionPath, ProviderInfo providerInfo)
|
||||
{
|
@ -35,7 +35,7 @@ using ASC.Files.Core.EF;
|
||||
using ASC.MessagingSystem.EF.Model;
|
||||
using ASC.Webhooks.Core.EF.Model;
|
||||
|
||||
namespace ASC.Migration.Core;
|
||||
namespace ASC.Migrations.Core;
|
||||
|
||||
public class MigrationContext: DbContext
|
||||
{
|
@ -1,45 +1,42 @@
|
||||
// (c) Copyright Ascensio System SIA 2010-2022
|
||||
//
|
||||
// This program is a free software product.
|
||||
// You can redistribute it and/or modify it under the terms
|
||||
// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
|
||||
// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
|
||||
// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
|
||||
// any third-party rights.
|
||||
//
|
||||
// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
|
||||
// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
//
|
||||
// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
|
||||
//
|
||||
// The interactive user interfaces in modified source and object code versions of the Program must
|
||||
// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
|
||||
//
|
||||
// Pursuant to Section 7(b) of the License you must retain the original Product logo when
|
||||
// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
|
||||
// trademark law for use of our trademarks.
|
||||
//
|
||||
// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
global using System.Configuration;
|
||||
global using System.Reflection;
|
||||
global using System.Text.RegularExpressions;
|
||||
|
||||
// (c) Copyright Ascensio System SIA 2010-2022
|
||||
//
|
||||
// This program is a free software product.
|
||||
// You can redistribute it and/or modify it under the terms
|
||||
// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
|
||||
// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
|
||||
// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
|
||||
// any third-party rights.
|
||||
//
|
||||
// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
|
||||
// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
//
|
||||
// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
|
||||
//
|
||||
// The interactive user interfaces in modified source and object code versions of the Program must
|
||||
// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
|
||||
//
|
||||
// Pursuant to Section 7(b) of the License you must retain the original Product logo when
|
||||
// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
|
||||
// trademark law for use of our trademarks.
|
||||
//
|
||||
// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
global using System.Reflection;
|
||||
global using System.Text.RegularExpressions;
|
||||
|
||||
global using ASC.Core.Common.EF;
|
||||
|
||||
global using Autofac;
|
||||
|
||||
global using Microsoft.Build.Construction;
|
||||
|
||||
global using Microsoft.Build.Construction;
|
||||
global using Microsoft.EntityFrameworkCore;
|
||||
global using Microsoft.EntityFrameworkCore.Design;
|
||||
global using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
global using Microsoft.EntityFrameworkCore.Migrations.Design;
|
||||
global using Microsoft.EntityFrameworkCore.Migrations.Operations;
|
||||
global using Microsoft.EntityFrameworkCore.Storage;
|
||||
global using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
global using Migration.Core.Models;
|
||||
global using Migration.Core.Utils;
|
||||
global using Microsoft.EntityFrameworkCore.Migrations.Design;
|
||||
global using Microsoft.EntityFrameworkCore.Migrations.Operations;
|
||||
global using Microsoft.EntityFrameworkCore.Storage;
|
||||
global using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
global using ASC.Migrations.Core.Models;
|
||||
global using ASC.Migrations.Core.Utils;
|
@ -24,7 +24,7 @@
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
namespace Migration.Core.Models;
|
||||
namespace ASC.Migrations.Core.Models;
|
||||
|
||||
public class ProjectInfo
|
||||
{
|
@ -24,10 +24,10 @@
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
namespace Migration.Core.Models;
|
||||
namespace ASC.Migrations.Core.Models;
|
||||
|
||||
public class ProviderInfo
|
||||
{
|
||||
{
|
||||
public string ConnectionString { get; set; }
|
||||
public Provider Provider { get; set; }
|
||||
public string ProviderFullName { get; set; }
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"profiles": {
|
||||
"ASC.Migration.Creator": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": false
|
||||
}
|
||||
}
|
||||
{
|
||||
"profiles": {
|
||||
"ASC.Migration.Creator": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": false
|
||||
}
|
||||
}
|
||||
}
|
@ -24,26 +24,26 @@
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace Migration.Core.Utils;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace ASC.Migrations.Core.Utils;
|
||||
|
||||
public class DbContextActivator
|
||||
{
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
{
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
|
||||
public DbContextActivator(IServiceProvider serviceProvider)
|
||||
{
|
||||
{
|
||||
_serviceProvider = serviceProvider;
|
||||
}
|
||||
}
|
||||
|
||||
public DbContext CreateInstance(Type contextType, ProviderInfo provider)
|
||||
{
|
||||
var scope = _serviceProvider.CreateScope();
|
||||
var configuration = scope.ServiceProvider.GetRequiredService<IConfiguration>();
|
||||
configuration["testAssembly"] = $"ASC.Migrations.{provider.Provider}";
|
||||
configuration["ConnectionStrings:default:name"] = "default";
|
||||
configuration["ConnectionStrings:default:connectionString"] = provider.ConnectionString;
|
||||
{
|
||||
var scope = _serviceProvider.CreateScope();
|
||||
var configuration = scope.ServiceProvider.GetRequiredService<IConfiguration>();
|
||||
configuration["testAssembly"] = $"ASC.Migrations.{provider.Provider}";
|
||||
configuration["ConnectionStrings:default:name"] = "default";
|
||||
configuration["ConnectionStrings:default:connectionString"] = provider.ConnectionString;
|
||||
configuration["ConnectionStrings:default:providerName"] = provider.ProviderFullName;
|
||||
return (DbContext)scope.ServiceProvider.GetRequiredService(contextType);
|
||||
}
|
@ -24,7 +24,7 @@
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
namespace Migration.Core.Utils;
|
||||
namespace ASC.Migrations.Core.Utils;
|
||||
|
||||
public static class EFCoreDesignTimeServices
|
||||
{
|
@ -1,34 +1,35 @@
|
||||
// (c) Copyright Ascensio System SIA 2010-2022
|
||||
//
|
||||
// This program is a free software product.
|
||||
// You can redistribute it and/or modify it under the terms
|
||||
// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
|
||||
// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
|
||||
// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
|
||||
// any third-party rights.
|
||||
//
|
||||
// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
|
||||
// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
//
|
||||
// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
|
||||
//
|
||||
// The interactive user interfaces in modified source and object code versions of the Program must
|
||||
// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
|
||||
//
|
||||
// Pursuant to Section 7(b) of the License you must retain the original Product logo when
|
||||
// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
|
||||
// trademark law for use of our trademarks.
|
||||
//
|
||||
// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
namespace Migration.Core.Utils;
|
||||
|
||||
public class Options
|
||||
{
|
||||
public string Path { get; set; }
|
||||
public IEnumerable<ProviderInfo> Providers { get; set; }
|
||||
public IEnumerable<ProviderInfo> TeamlabsiteProviders { get; set; }
|
||||
}
|
||||
// (c) Copyright Ascensio System SIA 2010-2022
|
||||
//
|
||||
// This program is a free software product.
|
||||
// You can redistribute it and/or modify it under the terms
|
||||
// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
|
||||
// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
|
||||
// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
|
||||
// any third-party rights.
|
||||
//
|
||||
// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
|
||||
// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
//
|
||||
// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
|
||||
//
|
||||
// The interactive user interfaces in modified source and object code versions of the Program must
|
||||
// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
|
||||
//
|
||||
// Pursuant to Section 7(b) of the License you must retain the original Product logo when
|
||||
// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
|
||||
// trademark law for use of our trademarks.
|
||||
//
|
||||
// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
|
||||
namespace ASC.Migrations.Core.Utils;
|
||||
|
||||
public class Options
|
||||
{
|
||||
public string Path { get; set; }
|
||||
public IEnumerable<ProviderInfo> Providers { get; set; }
|
||||
public IEnumerable<ProviderInfo> TeamlabsiteProviders { get; set; }
|
||||
}
|
@ -9,7 +9,7 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\common\ASC.ActiveDirectory\ASC.ActiveDirectory.csproj" />
|
||||
<ProjectReference Include="..\..\common\ASC.Data.Backup.Core\ASC.Data.Backup.Core.csproj" />
|
||||
<ProjectReference Include="..\..\common\Tools\ASC.Migration.Core\ASC.Migration.Core.csproj" />
|
||||
<ProjectReference Include="..\..\common\Tools\ASC.Migrations.Core\ASC.Migrations.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -1,6 +1,6 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using ASC.Migration.Core;
|
||||
using ASC.Migrations.Core;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
@ -9,7 +9,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
||||
namespace ASC.Migrations.MySql.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class MigrationContextMigrate : Microsoft.EntityFrameworkCore.Migrations.Migration
|
||||
public partial class MigrationContextMigrate : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
|
@ -1,6 +1,6 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using ASC.Migration.Core;
|
||||
using ASC.Migrations.Core;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
@ -8,7 +8,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ASC.Migrations.MySql.Migrations.Migration
|
||||
namespace ASC.Migrations.MySql.Migrations.Migrations
|
||||
{
|
||||
[DbContext(typeof(MigrationContext))]
|
||||
[Migration("20230619132829_CoreDbContext_Upgrade1")]
|
||||
|
@ -2,14 +2,16 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ASC.Migrations.MySql.Migrations.Migration
|
||||
namespace ASC.Migrations.MySql.Migrations.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class MigrationContextUpgrade1 : Microsoft.EntityFrameworkCore.Migrations.Migration
|
||||
public partial class MigrationContextUpgrade1 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql("UPDATE tenants_quotarow SET tenant = -1 WHERE tenant = 0;");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_audit_events_tenants_tenants_tenant_id",
|
||||
table: "audit_events",
|
||||
|
@ -1,6 +1,6 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using ASC.Migration.Core;
|
||||
using ASC.Migrations.Core;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
@ -9,7 +9,7 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\common\ASC.ActiveDirectory\ASC.ActiveDirectory.csproj" />
|
||||
<ProjectReference Include="..\..\common\ASC.Data.Backup.Core\ASC.Data.Backup.Core.csproj" />
|
||||
<ProjectReference Include="..\..\common\Tools\ASC.Migration.Core\ASC.Migration.Core.csproj" />
|
||||
<ProjectReference Include="..\..\common\Tools\ASC.Migrations.Core\ASC.Migrations.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -1,6 +1,6 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using ASC.Migration.Core;
|
||||
using ASC.Migrations.Core;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
@ -9,7 +9,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
namespace ASC.Migrations.PostgreSql.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class MigrationContextMigrate : Microsoft.EntityFrameworkCore.Migrations.Migration
|
||||
public partial class MigrationContextMigrate : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
|
@ -1,6 +1,6 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using ASC.Migration.Core;
|
||||
using ASC.Migrations.Core;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
||||
namespace ASC.Migrations.PostgreSql.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class MigrationContextUpgrade1 : Microsoft.EntityFrameworkCore.Migrations.Migration
|
||||
public partial class MigrationContextUpgrade1 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
|
@ -1,6 +1,6 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using ASC.Migration.Core;
|
||||
using ASC.Migrations.Core;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
@ -60,7 +60,7 @@ public class ThumbnailSettings
|
||||
private string _formats;
|
||||
public string Formats
|
||||
{
|
||||
get => _formats ?? ".pptx|.pptm|.ppt|.ppsx|.ppsm|.pps|.potx|.potm|.pot|.odp|.fodp|.otp|.gslides|.xlsx|.xlsm|.xls|.xltx|.xltm|.xlt|.ods|.fods|.ots|.gsheet|.csv|.docx|.docxf|.oform|.docm|.doc|.dotx|.dotm|.dot|.odt|.fodt|.ott|.gdoc|.txt|.rtf|.mht|.html|.htm|.fb2|.epub|.pdf|.djvu|.xps|.oxps";
|
||||
get => _formats ?? ".dps|.dpt|.fodp|.odp|.otp|.pot|.potm|.potx|.pps|.ppsm|.ppsx|.ppt|.pptm|.pptx|.sxi|.csv|.et|.ett|.fods|.ods|.ots|.sxc|.xls|.xlsb|.xlsm|.xlsx|.xlt|.xltm|.xltx|.xml|.djvu|.doc|.docm|.docx|.docxf|.oform|.dot|.dotm|.dotx|.epub|.fb2|.fodt|.htm|.html|.mht|.mhtml|.odt|.ott|.oxps|.pdf|.rtf|.stw|.sxw|.txt|.wps|.wpt|.xml|.xps";
|
||||
set => _formats = value;
|
||||
}
|
||||
|
||||
|
@ -259,13 +259,13 @@ public class GlobalStore
|
||||
|
||||
public async Task<IDataStore> GetStoreAsync(bool currentTenant = true)
|
||||
{
|
||||
return await _storageFactory.GetStorageAsync(currentTenant ? await _tenantManager.GetCurrentTenantIdAsync() : null, FileConstant.StorageModule);
|
||||
return await _storageFactory.GetStorageAsync(currentTenant ? await _tenantManager.GetCurrentTenantIdAsync() : -1, FileConstant.StorageModule);
|
||||
}
|
||||
|
||||
|
||||
public async Task<IDataStore> GetStoreTemplateAsync()
|
||||
{
|
||||
return await _storageFactory.GetStorageAsync(null, FileConstant.StorageTemplate);
|
||||
return await _storageFactory.GetStorageAsync(-1, FileConstant.StorageTemplate);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -651,7 +651,7 @@ public class TenantWhiteLabelSettingsHelper
|
||||
return null;
|
||||
}
|
||||
|
||||
var partnerStorage = await _storageFactory.GetStorageAsync(null, "static_partnerdata");
|
||||
var partnerStorage = await _storageFactory.GetStorageAsync(-1, "static_partnerdata");
|
||||
|
||||
if (partnerStorage == null)
|
||||
{
|
||||
@ -659,7 +659,7 @@ public class TenantWhiteLabelSettingsHelper
|
||||
}
|
||||
|
||||
var logoPath = BuildLogoFileName(type, partnerSettings.GetExt(type), dark);
|
||||
|
||||
|
||||
return (await partnerStorage.IsFileAsync(logoPath)) ? (await partnerStorage.GetUriAsync(logoPath)).ToString() : null;
|
||||
}
|
||||
|
||||
@ -703,7 +703,7 @@ public class TenantWhiteLabelSettingsHelper
|
||||
return null;
|
||||
}
|
||||
|
||||
var partnerStorage = await _storageFactory.GetStorageAsync(null, "static_partnerdata");
|
||||
var partnerStorage = await _storageFactory.GetStorageAsync(-1, "static_partnerdata");
|
||||
|
||||
if (partnerStorage == null)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user