Skip to content

Instantly share code, notes, and snippets.

@manoj-choudhari-git
Created July 21, 2021 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manoj-choudhari-git/dbc128b0fc198ec1708d4484f9f1b33c to your computer and use it in GitHub Desktop.
Save manoj-choudhari-git/dbc128b0fc198ec1708d4484f9f1b33c to your computer and use it in GitHub Desktop.
.NET EF Core - DOTNET CLI commands to create new database
## Delete existing database
dotnet ef database update 0 --context UniversityContext
## Remove all existing migrations
dotnet ef migrations remove --context UniversityContext
## Add new migration
dotnet ef migrations add InitialCreate --context UniversityContext
## Apply migration to the database
dotnet ef database update --context UniversityContext
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment