-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Labels
Description
Idea: pgosc
should support the ability to reverse the change (with no data loss) after the alter
statements and swap has happened. pgosc
should make sure that the data is being replayed in both directions (tables) before and after the swap. So in case of any issues, you can always go back to the original table.
Requires re-acrchitecting some core constructs. Most things should be re-usable.
A separate command/invocation point can be used to go back to the previous state. I am thinking -
- Perform alterations as usual without dropping the table in the end (thus making it easier to go back). Example:
pg-online-schema-change perform -a "ALTER..." --drop false ....
- Next, perform reversal by providing the primary table name
pg-online-schema-change reverse -t "books"
This involves re-transferring the FKs and running analyze (?).
nfm