-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEf executed commands.txt
24 lines (17 loc) · 2.53 KB
/
Ef executed commands.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
In powershell, under adm's account:
dotnet tool install --global dotnet-ef
Pointing to TheGame.InfrastructureProject:
dotnet ef migrations add Initial -o Data\Ef\Migrations --project TheGame.Infrastructure -- --connectionString="Server=.;Database=TheGame;Integrated security=SSPI;MultipleActiveResultSets=true;Packet size=16384"
dotnet ef database update --project TheGame.Infrastructure -- --connectionString="Server=.;Database=TheGame;Integrated security=SSPI;MultipleActiveResultSets=true;Packet size=16384"
dotnet ef migrations add NewMatchDateField -o Data\Ef\Migrations --project TheGame.Infrastructure -- --connectionString="Server=.;Database=TheGame;Integrated security=SSPI;MultipleActiveResultSets=true;Packet size=16384"
dotnet ef database update --project TheGame.Infrastructure -- --connectionString="Server=.;Database=TheGame;Integrated security=SSPI;MultipleActiveResultSets=true;Packet size=16384"
dotnet ef migrations add PlayerScoreLastUpdateOnDateField -o Data\Ef\Migrations --project TheGame.Infrastructure -- --connectionString="Server=.;Database=TheGame;Integrated security=SSPI;MultipleActiveResultSets=true;Packet size=16384"
dotnet ef database update --project TheGame.Infrastructure -- --connectionString="Server=.;Database=TheGame;Integrated security=SSPI;MultipleActiveResultSets=true;Packet size=16384"
dotnet ef migrations add PlayerScoreLastUpdateOnDateFieldFix -o Data\Ef\Migrations --project TheGame.Infrastructure -- --connectionString="Server=.;Database=TheGame;Integrated security=SSPI;MultipleActiveResultSets=true;Packet size=16384"
Whenever you wish to commit the migration, run the following command
dotnet ef database update --project TheGame.Infrastructure -- --connectionString="Server=.;Database=TheGame;Integrated security=SSPI;MultipleActiveResultSets=true;Packet size=16384"
I ran this command after I have implemented a IHost method extension that automates the migrations as well as the data seeding operations during manual migration applications(refer to MigrationManager.cs and XxxEntityConfiguration class files)
(You can this command whenever you with to tear the database down)
dotnet ef database drop --force --project TheGame.Infrastructure -- --connectionString="Server=.;Database=TheGame;Integrated security=SSPI;MultipleActiveResultSets=true;Packet size=16384"
Whenever you wish to erase the just-created migration, run the following command
dotnet ef migrations remove --project TheGame.Infrastructure -- --connectionString="Server=.;Database=TheGame;Integrated security=SSPI;MultipleActiveResultSets=true;Packet size=16384"