Problem description:
In our project we have one "production database" and many "devs". We want to know how we can manage and install the changes. We already have some procedures but it takes a lot of time and sometimes causes errors.
We can't lose data - so we can't use "drop table". We can only use "alter table".
Our actual "db versioning procedure" is like this:
- We have a table named [actual_version] that contains the actual version of the installed db schema
- We have a file named "changes_script.sql" that contains all database changes - this file is stored on SVN
When a developer wants to commit a new revision on SVN he needs to change_script.sql by adding 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 a better idea?