EF附加迁移产生空迁移 [英] EF add-migration generates empty migration
本文介绍了EF附加迁移产生空迁移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我加入到我的模型的新表:
I added into my model a new table:
public DbSet<ReturnedTransactions> ReturnedTransactions { get; set; }
我希望我的迁移生成的表给我,所以我所做的:
And i want my migrations to generate that table for me, so i did:
PM> Add-migration returnedTransactions
和它产生的
public partial class returnedTransactions : DbMigration
{
public override void Up()
{
}
public override void Down()
{
}
}
如何强制这件事能够生成正确的code给我吗?
How do i force this thing to generate proper code for me?
推荐答案
我只是有这个问题,我说 - 强制到Add-迁移命令和它的工作。
I just had this problem and I added -Force to the Add-Migration command and it worked.
这篇关于EF附加迁移产生空迁移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文