Say I have a hand-written script which performs a bunch of schema changes, eg: (plucked from air):
- Adds 2 columns to an existing table
- Creates a new stored procedure
- Alters an existing stored procedure
And, after running this, we discover that we need to revert back to before this entire script was run.
Is this possible?
In the meantime, data will have been flowing in. We can't throw away the new data (ie: we can't restore a backup of the whole database), but we don't care about any data from the 2 new columns.
I'm looking for a better solution than writing up an explicit "undo" script (with, for example, DROP COLUMN
statements and old procedure definitions) every time we make schema changes.