加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net-mvc – 如何降级Visual Studio 2012中的Entity Framewor

发布时间:2020-12-15 23:17:39 所属栏目:asp.Net 来源:网络整理
导读:我注意到,当我使用加载迁移创建代码第一个数据库迁移时,它会生成一个Down()方法以及一个Up()方法. 如何告诉我的数据库降级? 解决方法 几乎放弃对谷歌的研究,我设法从这里找到这个报价: http://msdn.microsoft.com/en-gb/data/jj591621.aspx#specific 哪个
我注意到,当我使用加载迁移创建代码第一个数据库迁移时,它会生成一个Down()方法以及一个Up()方法.

如何告诉我的数据库降级?

解决方法

几乎放弃对谷歌的研究,我设法从这里找到这个报价:

> http://msdn.microsoft.com/en-gb/data/jj591621.aspx#specific

哪个指定:

Let’s say we want to migrate our database to the state it was in after running our AddBlogUrl migration. We can use the –TargetMigration switch to downgrade to this migration.

Run the Update-Database –TargetMigration: AddBlogUrl command in Package Manager Console.
This command will run the Down script for our AddBlogAbstract and AddPostClass migrations.

If you want to roll all the way back to an empty database then you can use the Update-Database –TargetMigration: $InitialDatabase command.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读