LinuxCommandLibrary

dotnet-ef

Perform design-time development tasks for Entity Framework Core.

TLDR

Update the database to a specified migration

$ dotnet ef database update [migration]
copy


Drop the database
$ dotnet ef database drop
copy


List available DbContext types
$ dotnet ef dbcontext list
copy


Generate code for a DbContext and entity types for a database
$ dotnet ef dbcontext scaffold [connection_string] [provider]
copy


Add a new migration
$ dotnet ef migrations add [name]
copy


Remove the last migration, rolling back the code changes that were done for the latest migration
$ dotnet ef migrations remove
copy


List available migrations
$ dotnet ef migrations list
copy


Generate a SQL script from migrations range
$ dotnet ef migrations script [from_migration] [to_migration]
copy

Copied to clipboard