EF Core migration and snapshot are not generated correctly

Eleonora Vasylenko 1 Reputation point
2022-05-11T08:03:48.547+00:00

We are updating our application from .Net Core 3.1 to .Net 6. We have a number of migrations created in .Net Core 3.1. that were created and applied to production long time ago.
When now I run Add-Migration for the first time ever on our application, the newly created migration and DB snapshot doesn't contain all the changes of all the previous migrations. For ex., some properties and not required (although they are configured to be required in old migrations), some indexes are missing (they were created via MigrationBuilder.Sql() method in previous migrations).
We won't apply this initial migration, because we already have these changes in the DB, but we will need the correct snapshot to create subsequent migrations
So I wonder if it is OK to make changes in the DB snapshot to make it correspond to the actual DB state?

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
697 questions
{count} votes