Skip to content

Commit

Permalink
Replace mod_log columns with a table
Browse files Browse the repository at this point in the history
https://eaflood.atlassian.net/browse/WATER-4563
https://eaflood.atlassian.net/browse/WATER-4564
https://eaflood.atlassian.net/browse/WATER-4565

> Part of the work to display a licence's history to users (mod log)

**It's a trap!**

We have fallen into making the same mistake as the previous team. When we believed that a version (charge, licence or return) had a one-to-one relationship with NALD mod log records a JSONB field in each was a suitable solution to capturing just the information we need. It's only the historic records we have to worry about after all.

But when we learned that a version record could be linked to multiple mod logs we should have taken a different approach. Instead, we ploughed on with our JSON column column [altering its name and default](#2612) to match. 🤦😬

Once you've started down the JSONB road, it is easy to get trapped!

Thankfully, we've come to our senses before this saw the light of day in production. The mod log data we are importing needs to go into its own table and we link our version records accordingly. A 'standard' relationship database solution.

This change drops the columns and adds a new table instead.
  • Loading branch information
Cruikshanks committed Aug 18, 2024
1 parent 9f1e3fa commit aee33b7
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit aee33b7

Please sign in to comment.