Skip to main content
Solved

Adding a new mandatory reference to a new table

  • September 23, 2025
  • 1 reply
  • 18 views

Tejo van de Bor
Captain
Forum|alt.badge.img+5

hi,

In data migration you can set default values for mandatory fields in an upgrade. But how do you fix this when this new mandatory field is a reference to the fk of a new table. There are no records yet in this new table, so you have to create a dummy record. When the field is not mandatory I use a MANUAL code to insert the dummy record, but the MANUAL code is executed in the last part of the update process, so the constraints will error before you can insert the record.

How can we fix this? 

Best answer by Anne Buit

Hi Tejo,

You can use the Model version specific upgrade scripts to perform the insert before the constraints are created.

This topic has been closed for replies.

1 reply

Anne Buit
Community Manager
Forum|alt.badge.img+5
  • Community Manager
  • Answer
  • September 23, 2025

Hi Tejo,

You can use the Model version specific upgrade scripts to perform the insert before the constraints are created.