krillgar
krillgar

Reputation: 12805

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?

Upvotes: 0

Views: 775

Answers (1)

Gibbon
Gibbon

Reputation: 2773

Trying to directly re-use migrations is not something recommended - it is suggested that you instead add new migrations and then delete out the Up / Down changes to essentially reset the migration to the current model / database configuration as suggested in the microsoft docs on the top

Upvotes: 1

Related Questions