We are running a script that creates data in one of the ClaimCenter tables. This table has a foreign key reference to contacts table, that we do not use.
We get an exception:
org.h2.jdbc.JdbcBatchUpdateException: Referential integrity constraint violation: CONSTRAINT_C7F2: PUBLIC.CCX_CLAIMCONTACTEMAILATTACHMENT_EXT FOREIGN KEY(CLAIMCONTACTID) REFERENCES PUBLIC.CC_CLAIMCONTACT(ID) SQLSTATE = 23506
SQL error code = 23506
Is there a way to create entries in CLAIMCONTACTEMAILATTACHMENT_EXT
without creating on CC_CLAIMCONTACT
or breaking this referential integrity and making it work?
We want to create records in CLAIMCONTACTEMAILATTACHMENT_EXT
without creating on CC_CLAIMCONTACT
.
I am assuming the following from your question:
If the 2 assumptions above are true then I think you should just modify your script to add the appropriate ClaimContact entities to the Claim in the same bundle that you are adding your ClaimContactEmailAttachment_Ext entities.
If, however, ClaimContactEmailAttachment_Ext is meant to be more of a admin type of data that can be used across multiple claims, then I would probably rename this entity to something more appropriate. If this is meant to be an admin data type, then there should not be a foreign key from this entity to a claim-level entity. The foreign key should be defined on the claim-level entity.