I had a discussion with our DBA about how to change a database schema. His opinion is that all changes must be reversible. For example:
- Obsolete tables/columns should not be dropped as soon as they become redundant. Instead, they should be kept for at least a few releases.
- Instead of renaming a table/column, create a new table/column and copy the contents from the old into the new
- When a stored proc/trigger named 'foo' needs to be modified, leave the original stored proc/trigger in place and create a new stored proc/trigger named 'foo2'. Of course, this means that all references to the stored proc/trigger must be updated to refer to the new name
The benefit of this approach is that the database can be switched to a previous version if (for example) a release fails and one needs to revert to a previous version of the application. This would not be possible if tables and columns were simply dropped.
I have my own opinions about the wisdom of this approach, but I'll keep them to myself for the time being for fear of biasing the responses. In case it makes any difference, the environment is a startup developing a social network app.