[Catalyst] command in Catalyst tute part 4 for generating schema files (static creation) using DBIx::Class::TimeStamp needs tobeupdated

hkclark at gmail.com hkclark at gmail.com
Sun Mar 22 00:18:13 GMT 2009


On Sat, Mar 21, 2009 at 6:16 PM, Octavian Râsnita <orasnita at gmail.com> wrote:
> From: <hkclark at gmail.com>
> On Sat, Mar 21, 2009 at 11:08 AM, Octavian Râsnita <orasnita at gmail.com>
> wrote:
>>
>> Kennedy
>>
>> Yes it works that way, but it doesn't create the Result directory and it
>> doesn't store the result classes in it. It just updates the old classes.
>> But if I delete the old classes, or at least the old schema class, it
>> creates the "Result" directory and put them in it, and it also creates the
>> new schema class which uses load_namespaces().
>> But in this second case, it doesn't remember what was after "do not modify
>> this or anything above" in the result classes, and the update should be
>> done
>> manually.
>>
>> And I don't know if this is the expected behaviour or there is a bug or I
>> am
>> doing something wrong.
>>
>> Octavian
>>
>
> Are you using v0.23 of Catalyst::Model::DBIC::Schema:
>
> perl -MCatalyst::Model::DBIC::Schema -e \
>       'print "$Catalyst::Model::DBIC::Schema::VERSION\n"'
>
> If so, it should create the Result directory and use load_namespaces
> instead of load_classes.
>
> If you are seeing something different, please let us know, but my
> understanding is that v0.23 should do load_namespaces by default.
>
> Thanks,
> Kennedy
>
> Yes, I use that version:
>
> C:\Documents and Settings\Octavian>perl -MCatalyst::Model::DBIC::Schema -e
> "print $Catalyst::Model::DBIC::Schema::VERSION"
> Subroutine initialize redefined at E:/perl510/site/lib/Class/C3.pm line 70.
> Subroutine uninitialize redefined at E:/perl510/site/lib/Class/C3.pm line
> 88.
> Subroutine reinitialize redefined at E:/perl510/site/lib/Class/C3.pm line
> 101.
> 0.23
>
> (With this occasion I've installed the latest version of Class::C3 and now
> those warnings don't appear anymore.)
>
> But I've tried again to re-create the result classes, however the schema
> class still uses load_classes() and the "Result" directory is not created.
>
> I've created another table in the database and I ran again the Catalyst
> helper, but the class for the new table is created in the same directory
> with the other classes, and still there is no Result directory created and
> the schema class still uses load_classes().
>
> If I delete at least the schema class file, the helper works fine and the
> new schema file uses load_namespaces() and the result classes are stored in
> the "Result" directory, but in that case what's after "do not modify this or
> anything above" is not remembered.
>
> I use:
> Windows XP Pro
> perl, v5.10.0 built for MSWin32-x86-multi-thread
> Catalyst::Helper::Model::DBIC::Schema version 0.23.
> DBIx::Class version 0.08008.
>
> (I've upgraded to DBIx::Class 0.08010 and tried again to create the class
> files, but with the same results.)
>
> I can't upgrade to the version 0.08012 because when I try to install
> DBIx::Class, it crashes the perl interpreter, and there is no ppm package
> for this version yet, but... is it important this upgrade?
>
> Octavian
>

Hi Octavian,

Thanks for the update.  If I'm reading your note correctly, it sounds
like it's working like it's supposed to.  As long as you have the
right version of C::M::DBIC::Schema, it will generate the Results
directory by default -- but "default" here assumes that there is not
an existing lib/MyApp/Schema.pm that uses load_classes -- if it finds
that it goes into "compatibility" mode and preserves what's there.
That's why the tutorial has you do an "rm lib/MyApp/Schema.pm" before
you run the "script/myapp_create.pl model ..." command.

Also, it won't carry over the stuff below the "do not modify" line
from the old files in "lib/MyApp/Schema" to the new files in
"lib/MyApp/Schema/Result".  See the note at the bottom of the "Create
Static DBIC Schema Files" section in MoreCatalystBasics.pod where it
explains that you have to migrate it manually or using something like
the "perl -MIO::All -e ..." script it provides.

Let me know if I'm missing you point or not making sense -- I
certainly want to know if something is wrong with the tut that I need
to fix.  But I *think* you are saying that it's working like it's
supposed to.

Regards,
Kennedy



More information about the Catalyst mailing list