asp.net - 如何重新运行迁移
问题描述
我确实创建了迁移
但是在 Up() 方法中,我调用了一个资源来创建如下视图:
public override void Up()
{
Sql(Resources.GetString("sql1").AsSqlString());
AddColumn("dbo.UserPreference", "ClientGraphCurrencyId", c => c.Int());
CreateIndex("dbo.UserPreference", "ClientGraphCurrencyId");
AddForeignKey("dbo.UserPreference", "ClientGraphCurrencyId", "dbo.Currency", "CurrencyId");
}
之后我对“sql1”资源进行了更改。
问题是如何重新运行迁移,以便对 sql1 的更新应用于 DB
我尝试过更新数据库,但它说:没有未决的显式迁移。
解决方案
推荐阅读
- r - 只有汇总数据(IQR,中位数)可用时的 Mann-Whitney U 检验
- php - 如何从不同站点的 php 表单上传信息?
- java - 如何在 requestbody 中只发送 id 而不是对象?
- javascript - 我的代码不适用于 forEach 方法
- compilation - 使用 RPM 编译 CentOS 内核时替换源文件
- android - 在 build.gradle 中实现卡片视图
- javascript - 如何提交数据然后发布到另一个页面 mongoDB/Node.js
- javascript - 监听函数内的更新
- javascript - 如何使用 Node.js 中的请求库获取原始 HTTP 消息正文?
- python - 如何更新 MySQL 中的列