Skip to content

EFMigration

ZhangYang edited this page Sep 7, 2019 · 2 revisions

Migrate Entity framework read model

If you want to change Entity framework read model, please follow EF migration steps:

  • Update data structures in ReadModelDbContext
  • Go to RestAirline/src/RestAirline.ReadModel.EntityFramework folder
  • dotnet ef migrations add "migration names"
  • dotnet ef database update

During development, you can use below command for drop readmodel:

USE master;
GO
ALTER DATABASE RestAirlineRead SET SINGLE_USER WITH ROLLBACK IMMEDIATE;DROP DATABASE RestAirlineRead;
GO
Clone this wiki locally