Maybe not THE best practice, but at least these will eliminate most problems.
And NO, these practice only applies to database WITHOUT foreign keys and other dependency between objects.
By the way, I only worked with DB2.
- One file per main object. Match the name of file and the object within. The idea is to follow the java object law.
- If migrating from files with many objects, eliminate all diff noise before you do teardown.
- Keep only ddl's, the final state of an object creating script. You also need a one-fits-all script to submit them all at one push.
- Keep schema alteration SQL's in another folder, only in release branch or trunk per release. Version the whole folder, which means keep only those for the migration from the last release.
For anyone needs foreign keys and other dependency between objects, try to hack the object naming and let them work through your deploy script.
I hope these will work. Please leave comments!
Nozoshyan is so cute.