Scaffold or map the model to match the current schema exactly (watch decimal precision, column types, FK and index names that EF6 conventions produced). Create an initial EF Core migration and mark it as already applied without running it: either delete the generated body of Up/Down so the baseline is empty, or keep the generated code (useful for creating new dev databases) and insert its row into __EFMigrationsHistory on existing databases. Verify with a schema compare (SqlPackage/DACPAC or a migration script against a restored copy of production) that model and database match and that the next migration is empty. Rehearse the whole process in staging first. Keep the old EF6 __MigrationHistory table only for reference, never as a source of truth. From then on generate idempotent SQL scripts (dotnet ef migrations script --idempotent) that are reviewed and run by the pipeline, not by Database.Migrate() at start-up.
Checks they can baseline a schema without destructive changes
Last updated 23 Nov 2026.