ef_core_examples.sh
· 522 B · Bash
原始檔案
# Creates a new migration
dotnet ef migrations add MigrationName --project "../Domain/Domain.csproj"
# Runs the migrations
dotnet ef database update --project "../Domain/Domain.csproj"
# Creates a SQL command that matches the migration
dotnet ef migrations script ---project "../Domain/Domain.csproj"
# Checks for pending model changes
dotnet ef migrations has-pending-model-changes --project "../Domain/Domain.csproj"
# Removes the most recent migration
dotnet ef migrations remove --project "../Domain/Domain.csproj"
| 1 | # Creates a new migration |
| 2 | dotnet ef migrations add MigrationName --project "../Domain/Domain.csproj" |
| 3 | |
| 4 | # Runs the migrations |
| 5 | dotnet ef database update --project "../Domain/Domain.csproj" |
| 6 | |
| 7 | # Creates a SQL command that matches the migration |
| 8 | dotnet ef migrations script ---project "../Domain/Domain.csproj" |
| 9 | |
| 10 | # Checks for pending model changes |
| 11 | dotnet ef migrations has-pending-model-changes --project "../Domain/Domain.csproj" |
| 12 | |
| 13 | # Removes the most recent migration |
| 14 | dotnet ef migrations remove --project "../Domain/Domain.csproj" |