[Phpwm] Installation / Deployment PHP scripts

David Goodwin david at codepoets.co.uk
Sat Feb 10 13:12:04 GMT 2007

Dave Holmes wrote:
> Does anyone on the list know of a good point of reference for creating PHP
> deployment scripts which can be used to upgrade databases from one version
> to another, in a similar sort of way to how sugar CRM goes about it.... 
> It's something I need to look at in the next month

As far as I'm aware, the normal approach to this involves having a 
version string/patch number stored in the database somewhere, and each 
time you need to 'upgrade' the db structure etc you effectively run a 
sequence of SQL commands that restructure the tables accordingly. So it 
would go along the lines of :

1) Look in DB, get patch #
2) Look in db dir, what's the greatest numbered file?
3) Do #1 and #2 equal? if so quit.
4) If not, run all files numbered greater than #1, and less than #2 in 
order, where each file contains a load of SQL schema changing statements.

It probably doesn't make it easy to revert to an older version though....


More information about the Phpwm mailing list