实体框架迁移“表不存在". [英] Entity framework migration "Table does not exist"
问题描述
我是实体框架的新手,我通过反向工程从我在mysqlworkbench中创建的Mysql数据库中创建了我的实体,然后在我的实体中添加了一些外键,然后又添加了迁移并尝试更新数据库,但是发生错误,它指示:表'pidev.pidev.personal'不存在"."pidev"是我的数据库的名称.personal是其他两个子类"candiadte"和"employee"的超类,并且im使用TPH作为继承策略.PLZ我需要一些帮助.
im new to entity framework , i created my entities from reverse engineering from a Mysql database that i have created in mysqlworkbench , and then i added some foreign keys in my entities and then i added a migration and tried to update my database but an error occured and it indicates that: "Table 'pidev.pidev.personal' doesn't exist". "pidev" is the name of my database. personal is a super class for two other subclasses "candiadte" and "employee" and im using TPH as inheritance strategy. PLZ i need some help.
推荐答案
感谢大家的答复,我在迁移文件中的UP()和DOWN()方法中解决了该问题,我在其中删除了数据库的名称.像这样的每一行"DropPrimaryKey(" pidev.personal);"==> DropPrimaryKey("personal");
thank you all for your replies , I SOLVED the problem in the UP() and DOWN()method in the migration file i removed the name of the database in each line like this "DropPrimaryKey("pidev.personal");" ==> DropPrimaryKey("personal");
这篇关于实体框架迁移“表不存在".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!