简体   繁体   English

之后我发生了添加迁移和更新数据库问题

[英]After when I made add-migration and update-database problem occur

I have to add a new model to my project here is model 我必须在我的项目中添加一个新模型,这里是模型

 public class Marking
    {
        [Key]
        public int IdMakring{get;set;}
        public int IdMema { get; set; }
        [ForeignKey("Author")]
        public string Authorr {get;set;}

    }

in model memyContext I added 在我添加的模型memyContext中

public DbSet<Marking> Marking { get; set; }

I did add-migration and update-database 我做了add-migration和update-database

add-migration initialll -Context  MemeGenerator.Data.ApplicationDbContext
add-migration initialll -Context  memyContext
update-database -Context  MemeGenerator.Data.ApplicationDbContext

when I made this, error show: 当我这样做时,错误显示:

在此输入图像描述

I tried ones more update-database but it didn't help. 我尝试了更多更新数据库,但它没有帮助。 Somebody see how can I fix this? 有人看到我该如何解决这个问题?

try to execute specifying migration name 尝试执行指定迁移名称

example : 例如:

dotnet ef database update 20190524150901_initialll

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 Nuget 命令上使用 Add-Migration 更新数据库? - How do i update-database using Add-Migration on Nuget command? 实体框架代码优先:迁移失败,更新数据库,强制不必要的(?)添加迁移 - Entity Framework code-first: migration fails with update-database, forces unneccessary(?) add-migration 在存在Cache.insert的地方进行添加迁移或更新数据库失败 - Add-migration or update-database fails where Cache.insert exists 初始迁移后,EF6中的update-database命令不起作用 - update-database command in EF6 not working after initial migration 实体框架要求在已附加迁移的情况下更新数据库 - Entity Framework asks to update-database when migration is already appended 在 Remove-Migration 和 Update-Database 之后删除 a.cs 迁移文件是否安全 - Is it safe to delete a .cs migration file after Remove-Migration and Update-Database 自动迁移和手动调用更新数据库 - Automatic Migration and manual invocation of Update-Database 如何在使用基于代码的迁移时停止添加迁移检查我的数据库没有挂起的迁移? - How can I stop Add-Migration checking my database has no pending migrations when using Code-Based migrations? 运行添加迁移时获取SerializationException - Getting SerializationException when running add-migration 添加迁移异常 - Add-migration Exeception
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM