Ambert
08/28/2023, 9:11 AMAn explicit DROP INDEX is not allowed on index 'umbracoContentVersionCultureVariation.IX_umbracoContentVersionCultureVariation_VersionId'. It is b
eing used for UNIQUE KEY constraint enforcement.
I'm getting this error when upgrading my DB from 11.4.1 to 12.1.
I checked the code and this is executed in https://github.com/umbraco/Umbraco-CMS/blob/d7ae0aa1299762c12fe83b4300637a5c0058c7cd/src/Umbraco.Infrastructure/Migrations/Upgrade/V_12_1_0/TablesIndexesImprovement.cs#L21
I checked the history for this table and I can only see a Create statement introduced in V8.0.0 https://github.com/umbraco/Umbraco-CMS/blob/d7ae0aa1299762c12fe83b4300637a5c0058c7cd/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddVariationTables2.cs#L15
which seem to add the correct indexes..
I've compared this with an fresh installation of 11.4 and it seems I have a few more Keys that are set, perhaps legacy (this was an upgrade from V8 to now v11/12)
The key I have 'extra' is the IX_umbracoContentVersionCultureVariation_VersionId
When I delete this, it gives the same error on UmbracpPropertyData
And guess what, here I also have an extra
IX_umbracoPropertyData_VersionId
On deleting both, the upgrade goes through fine, but this should of course be done automatically..
Now I'm not a db expert regarding these things. But does anyone have a pointer on what's the proper way to fix this ?
I've just tested with a clean V8 and a clean V8.18 and a V9.0 and nowhere these extra key's are set... hmmm now it gets weird 🙂