Pin*_*nch 9 entity-framework code-first
我创建了一个Code First类
数据库是在Sql中自动创建的.
我删除了表:(
我启用了迁移:
AutomaticMigrationsEnabled = true;
AutomaticMigrationDataLossAllowed = true;
Database.SetInitializer(new DropCreateDatabaseAlways<SurveyContext>());
Run Code Online (Sandbox Code Playgroud)
然而
update-database -force
Cannot find the object "dbo.CustomerResponses" because it does not exist or you do not have permissions.
Run Code Online (Sandbox Code Playgroud)
请帮忙.
在系统表中有一个名为的表
__MigrationHistory
Run Code Online (Sandbox Code Playgroud)
...我已经把它删了.
在包管理器控制台中运行命令"update-database"问题已修复!
更多信息: