Failed Cashiering deployment with the error FOREIGN KEY constraint FK_ItemDetailItemReferenceValue



Description of Issue

Cashiering deployment failed with the error The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_ItemDetailItemReferenceValue". The conflict occurred in database "xxxxxxx", table "dbo.ItemDetails", column 'PaymentId'.



Context

Cashiering(web)



Cause

The issue is related to a data condition with data existing for the same payment Id for db.Payments and db.ItemReferenceValues and missing data in db.ItemDetails. There should be data in all three tables linked to the same PaymentId.



Resolution

Resolution is to insert the missing ItemDetails records in the database. A support case be submitted to Cashiering support or a service desk ticket with Cashiering development. The Cashiering deployment will need to be run after the records have been inserted.



Additional Information