I'm not a PHP expert, but assuming that you're thinking about versioning, it might be useful to look at what Wordpress does in its database update script. In general, it keeps a db schema version number, a set of upgrade code for each step between schema versions, and then just runs through the upgrade steps between the schema version stored in the db and the current version.
That handles differences due to application updates, and can account for things like the need to sanitize certain strings due to a bug between versions 1.2.3 and 1.2.4, but are you also concerned about people manually mucking about with the tables? Or sharing tables with other apps or using tables created externally?


Reply With Quote