Problem description:
In our project we have one "production database" and many "devs". Problem is how to manage and install the changes. We already have some procedure but its take a lot of time and sometimes cause errors.
We can't lose the data - so we cant use "drop table" but only "alter table".
Our actual "db versioning procedure":
- we have table [acctual_version] that contains actual version of installed db schema
- We have file name "changes_script.sql" that contains all database changes - this file is stored on SVN
When a developer want to commit new revision on svn he need to add to change_script.sql a block:
if ([acctual_version].version < "23")) {
--- sql script ----
updateVersionTo("23")
end if
When we want to upgrade the database schema we just "execute" the change_scripts.sql
Does anyone have better idea?