c# - 为什么实体框架中的迁移文件在 up() 和 down() 方法中没有代码?
问题描述
我正在尝试使用名称创建一个新的迁移InitialModel
。但是,当我打开迁移文件时,我只能看到空up()
和down()
方法。createTable()
方法中应该有up()
方法。我已经删除了迁移,更新了数据库并开始了一个新项目,但是,这些都没有奏效。有人可以告诉我如何获取迁移文件以显示createTable
方法吗?
public partial class initialModel : DbMigration
{
public override void Up()
{
}
public override void Down()
{
}
}
解决方案
This was resolved by enabling the authentication option at the beginning. This creates a model called IdentityModel.cs which has the code for creating the methods in the up() and down() methods.
推荐阅读
- java - Groovy Shell 脚本对象未完全执行
- java - 从表 1 中获取用户列表,然后与表 2 中的数据进行比较
- angular - RXJS - 3 个并行的 observables,然后发出值并使用它来调用 3 个串联的 observables
- javascript - 如何访问 jquery 中的 css * 选择器?
- asp.net - 简单电子邮件服务中的 Web API 和电子邮件配置
- mysql - 无法从 cronjob 运行 smbclient 进行远程文件共享
- clickhouse - clickhouse分布式查询实现需要步骤
- java - 模块信息中的 Javadoc 注释
- docker - 使用 docker 镜像在 Mesos 上运行 Spark
- mongodb - 如何指定作为对象数组的字段,数组对象在 Mongoose 中具有唯一但可选的属性之一?