From: "Kiffin Gish" <kiffin.g...@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.g...@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

_______________________________________________
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