Here's how you do it:
- every database has a build number stamped into it
- every schema change goes into a change script called build_105-106.sql
- changes are applied to the dev database as they are made
- the automated build pins the change script and runs it against an integration database
- a schema diff tool is used to compare dev and integration schemas. if they don't match, the build breaks.
- the build creates a file called build_106-107.sql and sticks it into source control
There's simply no way you can get your schemas out of synch this way. If you screw up and commit a change straight to dev without scripting out the change, it will break the next build and it will hurt to fix it. You'll learn quickly not to try to shortcut the process. (It's really not that hard a process anyway).But the big thing the author is getting wrong is that he's trying to define schema from his application. His ORM seems to be generating both code and schema from config files, which seems a bit silly from an outsider's viewpoint. It's causing him a lot of pain and he doesn't understand why.
Define the schema in the schema. Generate your code from that. Problem solved.