On Thu, Юни 15, 2006 9:15 pm, Benjamin Blazke wrote:
> Hi,
>
> I'm looking for a tool that given an existing (base)
> database schema and an 'update patch' DDL .sql script
> on input would produce a 'reverse' script that could
> be used to undo the changes done by the patch. For
> example:
>
> base.sql:
> CREATE TABLE xxx (...);
>
> patch.sql:
> CREATE TABLE yyy (...);
> ALTER TABLE xxx ADD COLUMN aaa ...;
> ALTER TABLE xxx CHANGE column bbb ...
>
> reverse.sql:
> DROP TABLE yyy;
> ALTER TABLE xxx DROP column aaa;
> ALTER TABLE xxx CHANGE column bbb <get this from the
> original base schema>
>
> The purpose of this exercise is to have a production
> database (MySQL) server that needs to update its
> schema once in a while to reflect the changes in the
> related application without the need to recreate the
> schema from scratch (and possibly losing data). The
> reverse.sql script could be later used to rollback the
> schema changes at any time, even rollback multiple
> patches.
>
> How do people generally solve this? I'm sure this must
> be a fairly common problem.
>
> Thanks.
>
> Ben
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> --
> gentoo-user@gentoo.org mailing list
>
>

If we're talking about a production system its very very bad idea to patch it 
directly.
The right way is to have an offline mirror of the system where you apply the
patches, test and only if they work fine, you apply the update on the production
system. If the patches are not OK, you just roll them back, restore from a 
backup,
or copy the live system over the offline one.

-- 
Best regards,
Daniel

-- 
gentoo-user@gentoo.org mailing list

Reply via email to