Hello,

you can pass a use_moose => 1 option to the make_schema_at as it's
described in the documentation here
https://metacpan.org/module/DBIx::Class::Schema::Loader#make_schema_at

However if you have already created the schema on your dev machine and you
checkout the code on another machine, it's more like that you want to
update the database structure using the existing schema? What I do usually
I have 2 small scripts one called deploy.pl and one called make_schema_at.pl
.

My make_schema_at.pl creates DBIx::Class schema from an existing database
and it looks like:

make_schema_at(
    'MyApp::Web::Schema',
    {
        debug     => 1,
        use_moose => 1,  # use_moose => 1 passed as a option
        dump_directory => "$Bin/../lib",
        components => ['UUIDColumns', 'TimeStamp',
'InflateColumn::DateTime', 'PassphraseColumn'],
    },
    [ $dsn ],
);

and my deploy.pl makes to opposite:

...
use MyApp::Web::Schema;

my $dsn = '..'; # get dsn from config
my $schema =  MyApp::Web::Schema->connect($dsn);
$schema->deploy();


You might want also to check the dbicdump (
https://metacpan.org/module/dbicdump ) where you can say -o use_moose=1

Cheers,
Dimitar

On Thu, Aug 30, 2012 at 11:25 AM, Octavian Rasnita <orasn...@gmail.com>wrote:

> **
> *From:* piet molenaar <piet....@gmail.com>
>
> *Subject:* [Catalyst] (no subject)
>
> Hi,
>
> We work with svn were we've committed the schema classes also into the 
> repository.
> Using the Catalyst helper script we tried to update the DBIC schema that was 
> created with
> the Catalyst helper after checkout on another machine and the following error 
> appeared.
>
> DBIx::Class::Schema::Loader::make_schema_at(): It is not possible to 
> "downgrade" a schema that was loaded with use_moose => 1 to use_moose => 0, 
> due to differing custom content at 
> /home/danny/perl5/lib/perl5/Catalyst/Helper/Model/DBIC/Schema.pm line 635
>
> I have to mention that we work both on Linux (Ubuntu) and Windows (7) 
> configurations. The error appeared after building the schema on the Windows 
> machine; checking it in and subsequently rebuilding (after changes) on Ubuntu.
>
>
> We also tried to install the latest version of DBIx::Class::Schema::Loader and
> the latest Catalyst helper, and then the latest DBIx::Class, and run the
> Catalyst helper to update the schema, but it still gives that error.
>
> What can we do? Where can we specify use_moose => 1 to make it work?
>
> We've looked into documentation but there is no mention about a best practice 
> of keeping the schema files out of a shared repository. Or am I confused here?
> I also noted that a similar question was posed on the DBIX mailing list, but 
> IMHO this list might be more appropriate.
>
>
> Cheers & thanks in advance,
> Piet
>
>
>
>
> Yep, I put that question on DBIC mailing list because actually is about
> DBIC, but got no answer, so if someone on Catalyst mailing list know...
> please help.
>
> I have the same problem. Development on Windows and use in production on
> Ubuntu and then tried to update the DBIC schema on Ubuntu.
>
> Octavian
>
>
>
> _______________________________________________
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>
_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to