Skip to content

EF Core Commands

dotnet ef migrations list --connection "Data Source=ctlsqlprod.database.windows.net;Initial Catalog=CTLShopFloorDB_Prod;MultipleActiveResultSets=True;persist security info=True;user id=Ctladmin;password=jI4#su#HoGaCqdn#;Application Name=CTL.ShopFloor" -s "./CTLShopFloor.Presentation.WebAPP/CTLShopFloor.Presentation.WebAPP.csproj" -p "./CTLShopFloor.Infrastructure.Persistance/CTLShopFloor.Infrastructure.Persistance.csproj" -c CTLShopFloor.Infrastructure.Persistance.DbContext.RepositoryDbContext
dotnet ef migrations add --project CTLShopFloor.Infrastructure.Persistance\CTLShopFloor.Infrastructure.Persistance.csproj --startup-project CTLShopFloor.Presentation.WebAPP\CTLShopFloor.Presentation.WebAPP.csproj --context CTLShopFloor.Infrastructure.Persistance.DbContext.RepositoryDbContext --configuration Debug <MIGRATION_NAME_HERE> --output-dir Migrations/RepositoryDb
dotnet ef database update --project CTLShopFloor.Infrastructure.Persistance\CTLShopFloor.Infrastructure.Persistance.csproj --startup-project CTLShopFloor.Presentation.WebAPP\CTLShopFloor.Presentation.WebAPP.csproj --context CTLShopFloor.Infrastructure.Persistance.DbContext.RepositoryDbContext --configuration Debug <PREVIOUS_MIGRATION_NAME>
dotnet ef migrations remove --project CTLShopFloor.Infrastructure.Persistance\CTLShopFloor.Infrastructure.Persistance.csproj --startup-project CTLShopFloor.Presentation.WebAPP\CTLShopFloor.Presentation.WebAPP.csproj --context CTLShopFloor.Infrastructure.Persistance.DbContext.RepositoryDbContext --configuration Debug