Unexpected RenameIndex
added to EF Core migration after upgrading from EF Core 3.1 to EF Core 6
#30231
Labels
RenameIndex
added to EF Core migration after upgrading from EF Core 3.1 to EF Core 6
#30231
I've upgraded my project references from:
to:
Now when I add a new database entity to my
DbContext
and runAdd-Migration ...
I get a load ofRenameIndex
calls in myUp
andDown
migration for existing tables, and I'm not sure why?For example I have an existing table called
trigger
which has an index calledIX_ConnectorEntry_Id
but in the added migrationUp
method it wants to rename it toIX_trigger_ConnectorEntry_Id
and in theDown
method it wants to put it back to what it was before.See:
It's trying to add the database name into the index name for some reason and its doing this for 111 existing indexes. The only way I can seem to stop this from happening is to add an explicit
HasDatabaseName(...)
in the entity configuration.See:
I've not found anywhere online that states there is a breaking change to the way default index names are generated when upgrading from EF Core 3.1 to EF Core 6.
Are the only options here to give in and let EF Core dictate my index names or have to manually set them with the explicit
HasDatabaseName(...)
?The text was updated successfully, but these errors were encountered: