[Chicago-talk] Database Migrations using DBIx::Class (instead)

Jonathan Rockway jon at jrock.us
Mon Mar 26 22:39:38 PDT 2007


On Tuesday 27 March 2007 00:23, Michael D. Stemle, Jr. wrote:
> Okay, so I'm trying to think up a way of making replicable migration
> scripts that are more portable for general distribution... DBIx::DBSchema
> kinda stuck out to me as a possible means of doing this.
>
> The problem is that I'm going through it, it's generating the SQL, but for
> some reason it's not executing it properly (as documented), so I'm kinda
> having to hack it a bit and manually execute the SQL that is generated. 
> It's not THAT big of a hack, but I was hoping to get it happy.

DBIx::Class is much nicer for this.  It supports schema versioning and 
automatic deployment to any supported database (SQLite, MySQL, Postgres, SQL 
Server, Sybase, DB2, and Oracle).  I can expand on this, but the DBIx::Class 
docs are pretty good and #dbix-class will probably help you with anything you 
need.

The only disadvantage is that version information is stored out-of-band on the 
filesystem, not in the database.

> I'm open to ideas.  Attached is the script I was playing with (signed).

s/constant/Readonly/;
s/our/my/;

:)

Regards,
Jonathan Rockway

-- 
package JAPH;use Catalyst qw/-Debug/;($;=JAPH)->config(name => do {
$,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //,
";$;"]->[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;->setup;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: not available
Url : http://mail.pm.org/pipermail/chicago-talk/attachments/20070327/320fdc09/attachment.bin 


More information about the Chicago-talk mailing list