重置实体框架 7 迁移 [英] Reset Entity Framework 7 migrations

查看:13
本文介绍了重置实体框架 7 迁移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 Entity Framework 7 beta 5.我从带有用户管理的 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

这篇关于重置实体框架 7 迁移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆