Are we supposed to delete migration snapshot when migrating db to .NET Core 2

1.5k views Asked by At

If we have existing database migrations and a snapshot file in our .NET Core 1 project, are we supposed to delete the snapshot in .Net Core 2 before we do a new migration?

EDIT:

I noticed the snapshot file with the new migration has a

.HasAnnotation("ProductVersion", "2.0.0-rtm-26452") Where as my previous migrations were:

.HasAnnotation("ProductVersion", "1.1.2")

It ef core just skipping my old migration files because of the different versions? Because I investigated my new migration file with all previous migrations and it looks like it has no knowledge of those previous ones.

1

There are 1 answers

3
Mitchel Sellers On

You should not need to delete anything as you to the migration, as the framework is smart enough to know what you are doing. Just make sure that when you upgrade your project that you do the following.

  1. Update all package references to the new 2.x versions
  2. Update all tooling references to the new 2.x versions

If you do this, you should be able to add a new migration without any issues after updating your project.