重置实体框架7迁移 [英] Reset Entity Framework 7 migrations
本文介绍了重置实体框架7迁移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Entity Framework 7 beta5.我从带有用户管理的mvc模板开始.在试用期间,我添加了几个迁移.
I'm using Entity Framework 7 beta 5. I started with the mvc template with user management. I have added several migrations, during my trials.
现在,我要删除数据库,创建一个新的初始迁移并使用它生成一个新的干净的数据库.
Now I want to delete my database, create a new initial migration and produce a new clean db with it.
但是dnx ef命令没有我所知道的命令,这将有助于实现这一点.我该如何进行?
However the dnx ef commands do not have a command that I know of that will facilitate this. How do I proceed?
推荐答案
您到底需要EF支持什么?这就是我要做的:
What exactly do you need support from EF for? Here's what I'd do:
- 删除数据库
- 删除所有迁移
- 配置上下文以指向新的,干净的 数据库
- 运行
dotnet ef migrations add <initial-migration-name>
- Delete your database
- Delete all your migrations
- Configure the context to point to your new, clean database
- Run
dotnet ef migrations add <initial-migration-name>
这篇关于重置实体框架7迁移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文