RMS200466: Known Issue - FOREIGN KEY constraint FK_HardwareValue_HardwareObject error thrown during database migration process

Problem

Whilst performing a migration from one version of RMS to another, the database migration process could fail due to experiencing a FOREIGN KEY constraint FK_SoftwareValue_SoftwareOccurence error. 

 

Cause

This issue will occur if the HardwareValue table contains records that do not have an associated record within the HardwareObject table.  This can easily be validated by running the following query against the database: 

SELECT * FROM HardwareValue 
WHERE HardwareObjectID NOT IN (SELECT HardwareObjectID FROM HardwareObject)

 

Solution

Run the following query to rectify this issue: 

DELETE From HardwareValue 
WHERE HardwareObjectID NOT IN (SELECT HardwareObjectID FROM HardwareObject)

 

Comments

Powered by Zendesk