From: Jess Robinson Date: Mon, 2 Apr 2007 22:19:05 +0000 (+0000) Subject: Add patch from dec to allow us to pick which sources to deploy X-Git-Tag: v0.08010~170 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=34d547782bda692a81b4b9c1178948b7b58ffa04;p=dbsrgits%2FDBIx-Class.git Add patch from dec to allow us to pick which sources to deploy --- diff --git a/lib/DBIx/Class/Schema.pm b/lib/DBIx/Class/Schema.pm index 3ab14fd..3418f85 100644 --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@ -744,6 +744,10 @@ See L for a list of values for C<$sqlt_args>. The most common value for this would be C<< { add_drop_table => 1, } >> to have the SQL produced include a DROP TABLE statement for each table created. +C can also be added to C<$sqlt_args> containing an array +reference of L names of tables to be deployed. Per default, +all tables are deployed. + =cut sub deploy { diff --git a/lib/SQL/Translator/Parser/DBIx/Class.pm b/lib/SQL/Translator/Parser/DBIx/Class.pm index d8af4d6..69782e5 100644 --- a/lib/SQL/Translator/Parser/DBIx/Class.pm +++ b/lib/SQL/Translator/Parser/DBIx/Class.pm @@ -42,11 +42,10 @@ sub parse { # print Dumper($dbixschema->registered_classes); - #foreach my $tableclass ($dbixschema->registered_classes) - my %seen_tables; - foreach my $moniker ($dbixschema->sources) + my @sources = exists $args->{'source_names'} ? @{ $args->{'source_names'} } : $dbixschema->sources; + foreach my $moniker (@sources) { #eval "use $tableclass"; #print("Can't load $tableclass"), next if($@);