EF 4.3 Migration - how to produce a downgrade script?

六月ゝ 毕业季﹏ 提交于 2019-12-04 01:37:07

It looks like migration API expects that you want to do downgrade only from "last version".

If BlogLimitsAndTableRename is your most recent migration (the last applied) you can simply run:

Update-Database -Script -TargetMigration:"201205161144187_AddPostAbstract"

If it is not your last migration you need to revert your development database to it first:

Update-Database -TargetMigration:"201205161203310_BlogLimitsAndTableRename"

and now you should be able to use the first command to get a script.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!