Skip to content

Conversation

@mchaib-k-int
Copy link
Contributor

Because so many columns were missing their constraint, I took a slightly different approach and made a list which contains the refDataCategory name, the table and the refDataValue column for each column that was missing a FK constraint on it.

There's then some scripting to iterate and apply the same changeset to each column:

  1. create the refDataCategory if it doesn't exist already
  2. create a "missing" refDataValue
  3. assign rows to the "missing" value's ID if they currently have a _fk column that points to a refDataValue that doesn't exist (e.g. because it was deleted)

Finally, there's a fourth changeset which creates the FK constraints for all of the columns.

Might be worth getting @EthanFreestone 's opinion on this?

@github-actions
Copy link

License CLA Stuck? (Developer should make sure that it is really stuck before clicking)

@mchaib-k-int
Copy link
Contributor Author

@Jack-Golding @EthanFreestone I've updated it to have all the changesets written out statically

@github-actions
Copy link

github-actions bot commented Jul 22, 2025

Test Results

204 tests  ±0   204 ✅ ±0   2m 2s ⏱️ +6s
  7 suites ±0     0 💤 ±0 
  7 files   ±0     0 ❌ ±0 

Results for commit 1ee0a7e. ± Comparison against base commit 177738e.

♻️ This comment has been updated with latest results.

@Jack-Golding Jack-Golding merged commit 8f5aa75 into master Jul 28, 2025
8 of 9 checks passed
@Jack-Golding Jack-Golding deleted the MODSER-127 branch July 28, 2025 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants