Originally learned time, quite smooth, did not expect to use again, or encountered a lot of problems, resulting in the failure of the update, so, can only reconstruct the migration, so as not to look at the chaos.
First, delete the migration, restore the data to the (a) End state
1. Delete Folder
2. Delete a table
3. Delete Columns
4. Comment out the newly added attributes
Second, re-operation EF6 in the original database using Codefirst Total review (second, new requirements, simple modification of the original table)
Among them, the blog entity was modified to
Iii. Results of operation
Isdelete default value and Isdelete = True in the blog entity constructor; Independent.
The new field is of type bool and the system is not allowed to be empty by default, so the default value is assigned to False (0)
Similarly, when a value type field is added, it should also be assigned a value of 0.
Iv. changing the constructor back to
There is no need to migrate because of database-independent.
V. Now the database table blogs has the Isdelete field, consistent with the entity object, and then run the previously generated interface
If the delete operation is not done, everything is fine.
Vi. Deleting a modified soft delete
Original code
Modified to:
Seven, re-run the system, add a new record
Tables in the database
Viii. Delete a newly created record
Tables in the database
Page Display list