Skip to content

Instantly share code, notes, and snippets.

@davidisnotnull
Last active February 23, 2022 22:33
Show Gist options
  • Save davidisnotnull/a4a534e3c784da962b222c2044e7eae6 to your computer and use it in GitHub Desktop.
Save davidisnotnull/a4a534e3c784da962b222c2044e7eae6 to your computer and use it in GitHub Desktop.
Enable EF Core migrations

Make sure you install Microsoft.EntityFrameworkCore.Design from nuget to allow migrations in the project. Then, open terminal and navigate to the root folder of the project in the solution that contains the EF implementation that you want to enable migrations on.

Create initial snapshot

dotnet ef migrations add InitialCreate

Run migration

dotnet ef database update

For further migrations, use

dotnet ef migrations add MigrationName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment