Replies: 5 comments 7 replies
-
@tomsmyers ,While doing the backfilling, I believe we will do a force update to mitigate the duplicate rows already created in both the tables? |
Beta Was this translation helpful? Give feedback.
-
At this point there should be
New pods would execute the deprecating migrations while "old code" is still running So we won't be able to do the rename/deprecation of fields in a migration as long as "old" tables are read in any way -- perhaps as a 4th step? (Which can go immediately after) |
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
-
step 1: step 2: @kth13 @sldblog this sql handles the potential duplication using |
Beta Was this translation helpful? Give feedback.
-
This is now live. |
Beta Was this translation helpful? Give feedback.
-
Context
We are working on a set of changes which allows referral details (maximum enforceable days, completion deadline, further information) to be updated in sent referrals. The updates must be fully traceable, i.e. who made the update, why the update was made, when the update was made, and what was changed.
The solution we have agreed upon to facilitate this behaviour is a seperate table (
referral_details
) with the following layout:Any changes to the referral details (for sent referrals) add a new row to this table. The history can be traced by stepping back via
superseded_by_id
s. The latest can be efficiently lookup byselect * from referral_details where referral_id = :referral_id and superseded_by_id is null
.The roll out
We have to be careful when rolling out this new data structure to ensure:
The following approach will be used (where each number indicates a seperate deployment):
referral
table. We can split this step into 2 if we want to.referral
table.Beta Was this translation helpful? Give feedback.
All reactions