-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added migrations script, updated migrations
- Loading branch information
Showing
8 changed files
with
169 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
@echo off | ||
title Create Migrations | ||
cd ../src/Core/Logistics.Infrastructure.EF | ||
|
||
call :CreateMigration "master database" "MasterDbContext" "Master" | ||
call :CreateMigration "tenant database" "TenantDbContext" "Tenant" | ||
|
||
pause | ||
goto :eof | ||
|
||
:CreateMigration | ||
set "DbType=%~1" | ||
set "DbContext=%~2" | ||
set "MigrationFolder=%~3" | ||
|
||
set /p CreateMigration="Do you want to create migration for the %DbType% (y/n): " | ||
if /I "%CreateMigration%" neq "y" goto :eof | ||
|
||
:prompt | ||
set "MigrationName=" | ||
set /p MigrationName="Enter migration name for the %DbType%: " | ||
if "%MigrationName%" == "" ( | ||
echo Error: Migration name cannot be empty. | ||
goto prompt | ||
) | ||
|
||
echo Running migration for the %DbType%... | ||
dotnet ef migrations add %MigrationName% -c %DbContext% -o Migrations/%MigrationFolder% | ||
echo Migrations completed. | ||
goto :eof |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
@echo off | ||
title Seed Databases | ||
dotnet run --project ../src/Core/Logistics.DbMigrator | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletions
16
...r/20231202003037_Version_0001.Designer.cs → ...r/20240105025909_Version_0001.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.