ef core data migration little sentiment

ef core at the time of the migration of data for mysql, sometimes not migrated. . .
There are two cases can not migrate, because one is not bug problem efcore causes migration, there is a problem that sets on GitHub, another data table is more substantial changes, navigation keys or the like results in the outer more changes can not be migrated properly, and involves the migration of a number of the table.

Then I myself wondering, how smooth the change data table without deleting all migration records out, then fumble for a while, really successful, follow these steps.

1. After the first backup table, delete the table.
2. On migration records in the table, delete all related to the migration of the table.
3. Delete the migration file records
4. Remove ModelSnapShop modelbuilder involved in the table
5. Re-add it to record the migration table
6. The successful implementation of the update-database, add this table in the database
7. will start backing up data changes after construction, re-imported into the new table.

So it is completed

Guess you like

Origin www.cnblogs.com/willhuo/p/11697507.html