I am working on some schema changes to an existing database.
I backed up the database to get a dev copy, and have made my changes. I will be creating a single roll script to migrate the changes on the production machine in a single transaction.
Is there a best practice for creating a rollback script encase a deployment issue arises? Before I've written then by hand using the following pattern:
- Drop new constraints and indexes
- Alter tables to remove new columns
- Drop added tables
- Commit transaction
Is there a better approach?