Page 1 of 1

Change control for... other things (table defs, external)

Posted: Sun Oct 30, 2005 10:19 pm
by Ambush Commander
Change control is all fine and dandy for source code control, but it kinda skips out table definition control. When software is unstable, the schema of the databases can change often and drastically, bouncing around so much that conversion scripts may be needed.

As of now, I'm doing table definition updates on an ad hoc basis: I try to remember if a particular push involved the creation of table, then I shut down the site, change the defs, run conversion scripts, upload the new program files, then turn the site on.

There must be a better way. How do you do it?

Posted: Wed Nov 02, 2005 8:54 am
by michel
You might want to check this thread at SitePoint's PHP App Design forum which brings up related issues.

Posted: Wed Nov 02, 2005 7:10 pm
by McGruff
Something I also need to work on. The general plan would be:

(1) The schema and (any conversion scripts) are kept in version control. Conversion scripts would be added at the same time as any schema changes and will need to be carefully unit tested. There may be scope for code generating conversion scripts for at least some types of database changes.

(2) Prior to install, there would be the usual full test run on a staging server or in a sandboxed area of the live site. This will be using the new database structure in tests.

(3) If (2) runs green, install for real and run all tests again to make sure the conversion worked properly. Backup the db first, of course, so you can roll back easily if something goes wrong. This would be a one-click operation wih an integration script automating all the work.