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.

https://msdn.microsoft.com/en-us/data/dn579398.aspx#step3


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -