You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Steps to reproduce:
1.Select any category dictionary property value for any category.
2. Do catalog export More/Platform Export/import/Export/ check catalog / export
3. Import resulting zip in the platform instance with empty catalog tables.
4. Got this exception The INSERT statement conflicted with the FOREIGN KEY constraint "FK_dbo.PropertyValue_dbo.PropertyDictionaryItem_DictionaryItemId". The conflict occurred in database "VirtoCommerce3", table "dbo.PropertyDictionaryItem", column 'Id'.
* - Fixed FK violation on import by changing export order + resolving property CatalogId and CategoryId after they are created;
- PropertyEntity.Patch: CategoryId and CatalogId are filled from source entity now;
- Fixed Sonar warnings with redundant parameters and string.Format();
- Replaced "..." with "…" (single symbol alt+0133 on numpad);
* Minor code refactoring
* Cleanup
Steps to reproduce:
1.Select any category dictionary property value for any category.
2. Do catalog export More/Platform Export/import/Export/ check catalog / export
3. Import resulting zip in the platform instance with empty catalog tables.
4. Got this exception
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_dbo.PropertyValue_dbo.PropertyDictionaryItem_DictionaryItemId". The conflict occurred in database "VirtoCommerce3", table "dbo.PropertyDictionaryItem", column 'Id'.
Technical details:
This happens because incorrect order of inserting data into the database, caused this reference violation.
The catalog data exports with this order. Catalogs, Categories, Properties, Dictionaries, Products and imported with the same order. And there is a situation when the system tried to insert Categories with property values earlier than these dictionary properties would be inserted into the database.
https://github.com/VirtoCommerce/vc-module-catalog/blob/master/VirtoCommerce.CatalogModule.Web/ExportImport/CatalogExportImport.cs#L87
The text was updated successfully, but these errors were encountered: