xxxxxxxxxx
dotnet tool install --global dotnet-ef
dotnet ef database drop
dotnet ef database update
dotnet ef migrations add InitialCreate
xxxxxxxxxx
For List command : get-help entityframework
Cmdlet Description
-------------------------- ---------------------------------------------------
Add-Migration Adds a new migration.
Bundle-Migration Creates an executable to update the database.
Drop-Database Drops the database.
Get-DbContext Lists and gets information about available DbContext types.
Get-Migration Lists available migrations.
Optimize-DbContext Generates a compiled version of the model used by the DbContext.
Remove-Migration Removes the last migration.
Scaffold-DbContext Scaffolds a DbContext and entity types for a database.
Script-DbContext Generates a SQL script from the DbContext. Bypasses any migrations.
Script-Migration Generates a SQL script from migrations.
Update-Database Updates the database to a specified migration.
xxxxxxxxxx
EntityFrameworkCore\Add-Migration VehiclesDBContextMigration -Context VehiclesDBContext
EntityFrameworkCore\Update-Database -Context VehiclesDBContext
xxxxxxxxxx
add-migration <migration name> Add <migration name> Creates a migration by adding a migration snapshot.
Remove-migration Remove Removes the last migration snapshot.
Update-database Update Updates the database schema based on the last migration snapshot.
Script-migration Script Generates a SQL script using all the migration snapshots.