Skip to content

Latest commit

 

History

History
59 lines (39 loc) · 983 Bytes

File metadata and controls

59 lines (39 loc) · 983 Bytes

EntityFrameworkCore Commands

Howto install EntityFramework tools

dotnet tool install --global dotnet-ef

Howto update EntityFramework tools

dotnet tool update --global dotnet-ef

Howto check version of EntityFrameworkCore

dotnet ef --version

Howto add a migration

dotnet ef migrations add <MigrationName>

Howto remove a migration not applied to database yet

dotnet ef migrations remove

Howto revert a migration ALREADY applied to database

dotnet ef database update <MigrationName-to-which-you-want-to-revert>
dotnet ef migrations remove

You need to run the remove command as many times as needed to go back to the MigrationName-to-which-you-want-to-revert

Howto apply migrations to database

dotnet ef database update

Howto get list of migrations

dotnet ef migrations list

Howto delete database

dotnet ef database drop