dbdeploy is a strategy for migrating a database from earlier to later versions through the use of delta SQL files. Originally implemented for Java, with a later evolution in Phing, PEAR, and .NET, the strategy is documented at:
http://dbdeploy.com/documentation/

Each delta has a change number, and when that numbered changed is applied to a given DB, the number is remembered in a changelog table. Thus, a change will be applied only once, to a given database, and the history of applied changes can be easily queried within the database itself.

Lots of applications have SQL that should be applied to the database. Those that do not already have a SQL migration practice inherent in their architecture often rely on ad-hoc means to upgrade a database. This leads wheels being reinvented, despite an established practice being available. A dbdeploy eclass would help these applications standardize on a means to apply SQL changes should their deployment environment not already provide one.

We have developed a dbdeploy eclass to allow ebuilds to apply database changes
from within the ebuild.  Our prototype implementation has concrete support for
generic/vanilla SQL (known to work on MySQL and PostgreSQL), but the design allows for plugging in specific DBMS syntax.

Our initial implementation is attached.

As you can see, the eclass is not concerned with the mechanics of reading from or writing to the database. That is package-dependent and is left to the package to implement. The eclass provides only the SQL necessary to list the changes applied so far and the SQL to apply changes from a given directory, as well as support for undoing failed changes.

Is this something the Gentoo community would be interested in having available?

thoughts?

Thanks!
bishop

--
Bishop Bettini
ideacode, Inc.
(main) +1 919 341 5170 / (fax) +1 919 521 4100

Visit us on the web at:
ideacode.com          Professional software research and development
reviewmysoftware.com  Improve sales! Review your software before you release
bytejar.com           Solutions to those annoying development problems

Attachment: dbdeploy.eclass
Description: Binary data

Reply via email to