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

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

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

Post 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?
michel
Forum Newbie
Posts: 1
Joined: Wed Nov 02, 2005 8:43 am

Post by michel »

You might want to check this thread at SitePoint's PHP App Design forum which brings up related issues.
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post 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.
Post Reply