Skip to content

Latest commit

 

History

History
45 lines (30 loc) · 1.01 KB

File metadata and controls

45 lines (30 loc) · 1.01 KB

Database migrations

This API is written in code-first mode using EF. It's recommended to read the README.md, to configure your database.

Go to project sources:

cd ./Sources/

Add migration

dotnet ef migrations add "MigrationName" --startup-project .\Shizima.WebAPI\Shizima.WebAPI.csproj -c DatabaseContext

Apply migration (update database)

dotnet ef database update --startup-project .\Shizima.WebAPI\Shizima.WebAPI.csproj -c DatabaseContext

Remove migration

dotnet ef migrations remove --startup-project .\Shizima.WebAPI\Shizima.WebAPI.csproj -c DatabaseContext

Drop database

dotnet ef database drop --startup-project .\Shizima.WebAPI\Shizima.WebAPI.csproj

List migrations

dotnet ef migrations list --startup-project .\Shizima.WebAPI\Shizima.WebAPI.csproj

Rollback to old migration

dotnet ef database update "OldMigrationName" --startup-project .\Shizima.WebAPI\Shizima.WebAPI.csproj -c DatabaseContext