在两次迁移之间强制种子数据迁移

时间:2020-05-14 13:51:16

标签: entity-framework entity-framework-6

我希望进行2次迁移。

  1. 创建新的货币表。
  2. 使用FK将现有表链接到货币并更新脚本。
Sql("UPDATE dbo.Rates" +
    " SET CurrencyId = c.Id" +
    " from Rates r" +
    " join Currencies c on c.IsoCode = r.CurrencyIso");

我还有填充货币表的种子数据。

我需要能够一次运行迁移1,运行种子,然后运行迁移2。

在引用FK之前如何将种子数据强制进入db?

0 个答案:

没有答案