Migrations: rename

This commit is contained in:
pavelbannov 2022-07-26 14:52:53 +03:00
parent e4df3b2371
commit 3d22992b7d
28 changed files with 17 additions and 19 deletions

View File

@ -21,11 +21,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.Migrations.PostgreSql",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.Core.Common", "common\ASC.Core.Common\ASC.Core.Common.csproj", "{A51D0454-4AFA-46DE-89D4-B03D37E1816C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Migration.Creator", "common\Tools\Migration.Creator\Migration.Creator.csproj", "{4BECDA03-E5E7-4273-B2D5-65AD3B1D0AF6}"
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}") = "Migration.Core", "common\Tools\Migration.Core\Migration.Core.csproj", "{4E971C04-8D1F-4C07-8D6F-C062C114CF7F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.Migration.Core", "common\Tools\ASC.Migration.Core\ASC.Migration.Core.csproj", "{4E971C04-8D1F-4C07-8D6F-C062C114CF7F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Migration.Runner", "common\Tools\Migration.Runner\Migration.Runner.csproj", "{249DC522-AC3B-475C-B77E-52CE0322E686}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.Migration.Runner", "common\Tools\ASC.Migration.Runner\ASC.Migration.Runner.csproj", "{249DC522-AC3B-475C-B77E-52CE0322E686}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@ -1,6 +1,10 @@
@echo "MIGRATIONS"
@echo off
PUSHD %~dp0..\common\Tools\Migration.Runner
dotnet run --project Migration.Runner.csproj
dotnet run --project Migration.Runner.csproj --options:Path=..\..\..\common\ASC.Data.Backup.Core\bin\Debug\net6.0
cd /D "%~dp0"
call start\stop.bat nopause
dotnet build ..\asc.web.slnf
dotnet build ..\ASC.Migrations.sln
PUSHD %~dp0..\common\Tools\ASC.Migration.Runner\bin\Debug\net6.0
dotnet ASC.Migration.Runner.dll
pause

View File

@ -1,6 +1,6 @@
{
"profiles": {
"Migration.Runner": {
"ASC.Migration.Creator": {
"commandName": "Project",
"launchBrowser": false
}

View File

@ -27,7 +27,7 @@
<ProjectReference Include="..\..\..\products\ASC.Files\Core\ASC.Files.Core.csproj" />
<ProjectReference Include="..\..\ASC.Core.Common\ASC.Core.Common.csproj" />
<ProjectReference Include="..\..\ASC.Data.Backup.Core\ASC.Data.Backup.Core.csproj" />
<ProjectReference Include="..\Migration.Core\Migration.Core.csproj" />
<ProjectReference Include="..\ASC.Migration.Core\ASC.Migration.Core.csproj" />
</ItemGroup>
</Project>

View File

@ -1,6 +1,6 @@
{
"profiles": {
"Migration.Creator": {
"ASC.Migration.Creator": {
"commandName": "Project",
"launchBrowser": false
}

View File

@ -27,7 +27,7 @@
<ProjectReference Include="..\..\..\products\ASC.Files\Core\ASC.Files.Core.csproj" />
<ProjectReference Include="..\..\ASC.Core.Common\ASC.Core.Common.csproj" />
<ProjectReference Include="..\..\ASC.Data.Backup.Core\ASC.Data.Backup.Core.csproj" />
<ProjectReference Include="..\Migration.Core\Migration.Core.csproj" />
<ProjectReference Include="..\ASC.Migration.Core\ASC.Migration.Core.csproj" />
</ItemGroup>
</Project>

View File

@ -37,16 +37,11 @@ class Program
var config = builder.Build();
var providersInfo = config.GetSection("options").Get<Options>();
var path = providersInfo.Path;
if (!Path.IsPathRooted(path))
{
path = Path.GetFullPath(path);
}
foreach (var providerInfo in providersInfo.Providers)
{
var migrationCreator = new MigrationRunner(providerInfo.ConnectionString);
migrationCreator.RunApplyMigrations(path, providerInfo);
migrationCreator.RunApplyMigrations(AppContext.BaseDirectory, providerInfo);
}
}
}

View File

@ -1,6 +1,6 @@
{
"profiles": {
"Migration.Creator": {
"ASC.Migration.Runner": {
"commandName": "Project",
"launchBrowser": false
}

View File

@ -1,11 +1,10 @@
{
"options": {
"Path": "../../../products/ASC.Files/Server/bin/Debug",
"Providers": [
{
"Provider": "MySql",
"ProviderFullName": "MySql.Data.MySqlClient",
"ConnectionString": "Server=localhost;Database=onlyoffice;User ID=root;Password=root"
"ConnectionString": "Server=localhost;Database=onlyoffice1;User ID=root;Password=root"
}
]
}