[Dbix-class] Ideas for database versioning.

Thomas Klausner domm at cpan.org
Tue Nov 6 16:11:01 GMT 2012


On Tue, Nov 06, 2012 at 07:21:00AM -0800, Bill Moseley wrote:
> Schema changes are frequent, but it's not like the volume of code changes.
>  Maybe a few new columns every week or so.   The problem is when there's a
> mistake it's potentially a big problem.   The trick, like always, is
> finding a solution that fits the problem size -- that doesn't introduce
> just as much risk or is overly complex.

We're using (and wrote...) DBIx::SchemaChecksum, which calcs a checksum 
of a current DB schema using DBI introspection. You can than build 
upgrade trees based on those checksums. It works good enough for us 
(using Postgres), but there are some issues (mainly downgrades, which 
are not supported (yet); and changing data together with the schema 
(though there are workarounde..))

The version currently on CPAN is quite out of date. Maros and me started 
an update effort on the train back from YAPC, which is nearly done. I 
plan to finish/release it for Austrian Perl Workshop (where I'll also do 
a talk on DBIx::SchemaChecksum).



#!/usr/bin/perl                              http://domm.plix.at
for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}

More information about the DBIx-Class mailing list