c# - Sync migrations with actual changes -
ef migrations not automatically detect complex changes, created empty migration , made changes hand up()
, down()
. updated database, , worked in both forward , reverse directions.
but later, when made more changes , created new migration, it automatically added kinds of changes not needed - handled them manually in previous migration.
i know can delete migrations , start scratch, that'll create far many problems, don't want that.
how fix this?
you can establish new baseline if don't have prior released databases out there. delete old migrations run:
add-migration mybaseline –ignorechanges update-database
now model , database in sync , can make model changes , create new migrations. turn automigrations on until ready deploy roll them single migration can script out clients.
Comments
Post a Comment