[Dbix-class] Versioned Cluelessness

Christopher H. Laco claco at chrislaco.com
Tue Jul 8 13:36:22 BST 2008


luke saunders wrote:
> On Tue, Jul 8, 2008 at 4:49 AM, Christopher Laco <claco at chrislaco.com> wr=
ote:
>> Christopher Laco wrote:
>>> What has me stumnped is the initial deploy. If I simply do:
>>>
>>>  $schema->connect('dbi:SQLite:database.db')->upgrade;
>>>
>>> I get warnings about the db not being versioned, and then the versioned
>>> table is created. However, no other schema tables are created. I thought
>>> that update() by itself ran all statements (run_upgrade sets ||=3D qr//=
;)
> =

> if the db isn't versioned then it's assumed that the database is
> already at the current version and all that happens is that the
> versioned table is created. i can see that this might be confusing so
> i'll beef out the docs later.
> =

> it probably also makes sense for Schema::Versioned to overload deploy
> so that the versioned table is created after that runs, then if you're
> starting from scratch you can deploy initially then run upgrades after
> that.

Yeah, the overloaded deploy would seem to close that gap between what =

happens and what's expected. Having never used Versioned before, I =

completely expected upgrade to deploy the entire schema since you're on =

version undef. Of course, running deply first, then upgrade just yields =

the addition of the versioned tables, but no upgrade scripts get run (if =

I was now on $VERSION=3D2).

-=3DChris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: OpenPGP digital signature
Url : http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20080708/c3=
2d1fd4/signature.pgp


More information about the DBIx-Class mailing list