FAQ
Normally myapp_create.pl is run with the whole database given on the
command line, e.g.

script/myapp_create.pl model DB DBIC::Schema MyApp::Schema \
create=static dbi:SQLite:myapp.db

Can I restrict this to a single table or tables only? For example, I
have an existing application and I add a new table I don't want to
recreate Schema/Results with a bunch of .new files and have to delete
them after-wards.

--
Kiffin Gish <Kiffin.Gish@planet.nl>
Gouda, The Netherlands

Search Discussions

  • Octavian Rasnita at Dec 25, 2009 at 3:05 pm
    From: "Kiffin Gish" <kiffin.gish@planet.nl>
    Normally myapp_create.pl is run with the whole database given on the
    command line, e.g.

    script/myapp_create.pl model DB DBIC::Schema MyApp::Schema \
    create=static dbi:SQLite:myapp.db

    Can I restrict this to a single table or tables only? For example, I
    have an existing application and I add a new table I don't want to
    recreate Schema/Results with a bunch of .new files and have to delete
    them after-wards.

    --
    Kiffin Gish <Kiffin.Gish@planet.nl>

    Don't know if it has that option, but the script below might help you:


    use warnings;
    use strict;
    use FindBin qw/$Bin/;
    use DBIx::Class::Schema::Loader qw/ make_schema_at /;

    my %options;
    if (@ARGV) {
    my $table = shift @ARGV;
    %options = (
    constraint => "^$table\$",
    #exclude => "^$table\$",
    components => [@ARGV]);
    }

    make_schema_at("MyApp::Schema",
    {
    %options,
    debug => 1,
    relationships => 1,
    use_namespaces => 1,
    dump_directory => "$Bin/../lib" ,
    },
    ["dbi:mysql:database=mydb",
    "user","password"]);

    Octavian
  • Alexander Hartmaier at Jan 5, 2010 at 1:16 pm
    Why not do it the other way round?
    Write the new class and deploy it to your db.

    --
    Best regards, Alex


    Am Freitag, den 25.12.2009, 15:51 +0100 schrieb Kiffin Gish:
    Normally myapp_create.pl is run with the whole database given on the
    command line, e.g.

    script/myapp_create.pl model DB DBIC::Schema MyApp::Schema \
    create=static dbi:SQLite:myapp.db

    Can I restrict this to a single table or tables only? For example, I
    have an existing application and I add a new table I don't want to
    recreate Schema/Results with a bunch of .new files and have to delete
    them after-wards.

    *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
    T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
    Handelsgericht Wien, FN 79340b
    *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
    Notice: This e-mail contains information that is confidential and may be privileged.
    If you are not the intended recipient, please notify the sender and then
    delete this e-mail immediately.
    *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedDec 25, '09 at 2:51p
activeJan 5, '10 at 1:16p
posts3
users3
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2021 Grokbase