简体   繁体   中英

Using EF Core migrations with existing EF6 migrations

I'm currently trying to refactor an existing .NET Framework enterprise project into .NET Core. I've gotten the classes moved to Core, as well as set up the Fluent Configurations for all the objects.

We are using EF's Migrations to manage the database, so we have our stack of migrations that exist in the __MigrationHistory table EF6 created. Now with EF Core, that wants to create an __EFMigrationsHistory table instead.

Is there any way to get EF Core to recognize all of the migrations that existed in that other table?

不建议尝试直接重用迁移,建议您改为添加新的迁移,然后删除Up / Down更改,以从本质上将迁移重置为当前模型/数据库配置,如Microsoft文档上的建议。最佳

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM