Skip to content

Ability to reverse the change post swapΒ #14

@shayonj

Description

@shayonj

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 -

  1. 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 ....
  1. 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 (?).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions