Update README with rollback and list commands.
This commit is contained in:
parent
b114a696a0
commit
1197b9ecea
10
README.md
10
README.md
@ -31,6 +31,10 @@ Create a migration, inside of the Console project, referring to the Data project
|
|||||||
|
|
||||||
`dotnet ef migrations add InitialMigration --startup-project ./ --project ../EntityFrameworkCore.Data`
|
`dotnet ef migrations add InitialMigration --startup-project ./ --project ../EntityFrameworkCore.Data`
|
||||||
|
|
||||||
|
Show migration status (`Get-Migration` has more details):
|
||||||
|
|
||||||
|
`dotnet ef migrations list --startup-project ./ --project ../EntityFrameworkCore.Data`
|
||||||
|
|
||||||
Update the database:
|
Update the database:
|
||||||
|
|
||||||
`dotnet ef database update --startup-project ./ --project ../EntityFrameworkCore.Data`
|
`dotnet ef database update --startup-project ./ --project ../EntityFrameworkCore.Data`
|
||||||
@ -51,6 +55,12 @@ Create migration script (This generates SQL of all the migrations). Add the `--i
|
|||||||
|
|
||||||
`dotnet ef migrations script --startup-project ./ --project ../EntityFrameworkCore.Data`
|
`dotnet ef migrations script --startup-project ./ --project ../EntityFrameworkCore.Data`
|
||||||
|
|
||||||
|
Rollback to specific migration, use `list` command to see (Pending) changes:
|
||||||
|
|
||||||
|
`dotnet ef database update 20250406180432_AddMatchAndLeagueEntities --startup-project ./ --project ../EntityFrameworkCore.Data`
|
||||||
|
|
||||||
|
To re-apply changes again, simply do a `database update` again. Beware that data will be lost.
|
||||||
|
|
||||||
## Links
|
## Links
|
||||||
|
|
||||||
* [Entity Framework - Database providers](https://learn.microsoft.com/en-us/ef/core/providers/?tabs=dotnet-core-cli)
|
* [Entity Framework - Database providers](https://learn.microsoft.com/en-us/ef/core/providers/?tabs=dotnet-core-cli)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user