Re: Re: SQL Source Control
| From: | Zoltán Németh | Date: | Wed, 11 Apr 2007 20:15:42 +0000 |
| Subject: | Re: Re: SQL Source Control | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-252625@lists.php.net to get a copy of this message | ||
2007. 04. 11, szerda keltezéssel 16.19-kor Colin Guthrie ezt írta:
> Richard Davey wrote:
> > Hi all,
> >
> > I know a lot of you use various means for PHP source control (CVS, SVN,
> > etc), which is all well and fine, but how do you manage source control
> > on your databases?
> >
> > Say you've got an upgrade to a site, all of the new PHP files are
> > controlled by SVN, so you can rollback at any time, but say the upgrade
> > includes several key modifications to a MySQL table and perhaps the
> > changing of some core data.
> >
> > How (if at all?!) do you handle the versioning of the database and data
> > itself, so you can keep both PHP and SQL structure in sync?
>
> Yeah this is a weak point in my chain too!
>
> I keep database schema's in a file which can start with a blank db and
> create all the tables allowing for modifications and updates etc. over
> time with new deployments.
>
> But if something breaks... rolling back is well. a pain....
>
> I could use a backup file and MySQL binary logs to replay to the point
> prior to deployment/update if the world depended on it, but this would
> take several hours to do and so I really wouldn't say I "relied" on this
> method.. it's more disaster recovery!
>
> Any suggestions in this area would be interesting.
yeah I have the same problem ;)
I have two kind of SQL files:
1) SQL of the complete, blank DB structure - I store it for each main
version (I should store it for each version if I wouldn't be so
lazy... ;) )
2) SQL instructions to upgrade from a DB version to another - I need
these to upgrade working databases
however I have no real solution for rollback, and if something is broken
in a new version and I have to revert a working DB to an older state,
well that's real serious trouble (and usually a lot of cursing and stuff
like that)....
so, if anyone has a good solution I also would like to hear it :)
greets
Zoltán Németh
>
> Col
>