简体   繁体   中英

mvc ef6 migration history deleted, want to restore but keep data

I am working on a ef6 mvc projeect and i deleted all migration records. I want to continue on the project with the current dj. I have a lot of data in there. I added an initial migration but I can't add migration after adding a model. As the tables that are in the initial migration already exist in the db.

Can someone help me how I can keep my zn, and get migrations going again? Thanks

perhaps try:

  1. Backup the DB as it is FIRST.
  2. You can try and restore the DB with migration history to a DIFFERENT database.
  3. Then copy the __MigrationHistory over.

eg copying table. (SQL server example) You may be using another DB... sorry Copy tables from one database to another in SQL Server

Then test if you that has resolved issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM