[Bast-commits] r3173 - in trunk/DBIx-Class/lib: DBIx/Class
SQL/Translator/Parser/DBIx
castaway at dev.catalyst.perl.org
castaway at dev.catalyst.perl.org
Mon Apr 2 23:19:06 GMT 2007
Author: castaway
Date: 2007-04-02 23:19:05 +0100 (Mon, 02 Apr 2007)
New Revision: 3173
Modified:
trunk/DBIx-Class/lib/DBIx/Class/Schema.pm
trunk/DBIx-Class/lib/SQL/Translator/Parser/DBIx/Class.pm
Log:
Add patch from dec to allow us to pick which sources to deploy
Modified: trunk/DBIx-Class/lib/DBIx/Class/Schema.pm
===================================================================
--- trunk/DBIx-Class/lib/DBIx/Class/Schema.pm 2007-03-31 06:54:51 UTC (rev 3172)
+++ trunk/DBIx-Class/lib/DBIx/Class/Schema.pm 2007-04-02 22:19:05 UTC (rev 3173)
@@ -744,6 +744,10 @@
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<source_names> can also be added to C<$sqlt_args> containing an array
+reference of L<source> names of tables to be deployed. Per default,
+all tables are deployed.
+
=cut
sub deploy {
Modified: trunk/DBIx-Class/lib/SQL/Translator/Parser/DBIx/Class.pm
===================================================================
--- trunk/DBIx-Class/lib/SQL/Translator/Parser/DBIx/Class.pm 2007-03-31 06:54:51 UTC (rev 3172)
+++ trunk/DBIx-Class/lib/SQL/Translator/Parser/DBIx/Class.pm 2007-04-02 22:19:05 UTC (rev 3173)
@@ -42,11 +42,10 @@
# 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($@);
More information about the Bast-commits
mailing list