Re:Pgroll: zero-downtime, undoable, schema migrations for Po...
by Already__Taken on Tuesday October 03, 2023 @01:36PM
(#37755055)
the 3 schemas is new to me and a cool idea but, how about a migration that removes a column into a few linking tables. what does that look like? I've changed note table colmun into a note-type and it's attached ID so you can add a note to anything. initially with notes from the original table colmun. how does that undo
[ Parent
| on HN ]
Re:Pgroll: zero-downtime, undoable, schema migrations for Po...
by exekias on Tuesday October 03, 2023 @02:33PM
(#37755773)
I didn't fully understand the change that you are explaining, but in general having old & new schemas working relies on the migration definition having the proper `up` & `down` functions defined. These are postgres functions so you can fit any logic in them to ensure that a column deleted in the new schema gets properly backfilled to the old one.
I wonder if there will be cases where this gets too complex or otherwise hits any limits. It may be possible that for those cases a raw SQL migration is required.