[Bast-commits] r5771 - in trunk/DBIx-Class-Schema-Loader: .
lib/DBIx/Class/Schema/Loader t/lib
timbunce at dev.catalyst.perl.org
timbunce at dev.catalyst.perl.org
Thu Mar 19 00:15:12 GMT 2009
Author: timbunce
Date: 2009-03-19 00:15:12 +0000 (Thu, 19 Mar 2009)
New Revision: 5771
Modified:
trunk/DBIx-Class-Schema-Loader/Changes
trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/Base.pm
trunk/DBIx-Class-Schema-Loader/t/lib/dbixcsl_common_tests.pm
Log:
Revert r5766 which was applied to the trunk instead of branches/current.
(r5766 has since been applied to branches/current as r5770)
Modified: trunk/DBIx-Class-Schema-Loader/Changes
===================================================================
--- trunk/DBIx-Class-Schema-Loader/Changes 2009-03-19 00:05:04 UTC (rev 5770)
+++ trunk/DBIx-Class-Schema-Loader/Changes 2009-03-19 00:15:12 UTC (rev 5771)
@@ -3,7 +3,6 @@
0.04006 Not Yet Released
- Fix Oracle constraint detection for non-owned schemas (RT #35732)
- Add result_base_class and schema_base_class options (RT #43977)
- - Ignore duplicate uniq indices (including duplicates of the PK).
0.04005 Sat Apr 05, 2008
- Fix DB2 support
Modified: trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/Base.pm
===================================================================
--- trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/Base.pm 2009-03-19 00:05:04 UTC (rev 5770)
+++ trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/Base.pm 2009-03-19 00:15:12 UTC (rev 5771)
@@ -672,22 +672,13 @@
);
}
- my %uniq_tag; # used to eliminate duplicate uniqs
-
my $pks = $self->_table_pk_info($table) || [];
@$pks ? $self->_dbic_stmt($table_class,'set_primary_key',@$pks)
: carp("$table has no primary key");
- $uniq_tag{ join("\0", @$pks) }++ if @$pks; # pk is a uniq
my $uniqs = $self->_table_uniq_info($table) || [];
- for (@$uniqs) {
- my ($name, $cols) = @$_;
+ $self->_dbic_stmt($table_class,'add_unique_constraint',@$_) for (@$uniqs);
- next if $uniq_tag{ join("\0", @$cols) }++; # skip duplicates
-
- $self->_dbic_stmt($table_class,'add_unique_constraint', $name, $cols);
- }
-
$schema_class->register_class($table_moniker, $table_class);
$schema->register_class($table_moniker, $table_class) if $schema ne $schema_class;
}
Modified: trunk/DBIx-Class-Schema-Loader/t/lib/dbixcsl_common_tests.pm
===================================================================
--- trunk/DBIx-Class-Schema-Loader/t/lib/dbixcsl_common_tests.pm 2009-03-19 00:05:04 UTC (rev 5770)
+++ trunk/DBIx-Class-Schema-Loader/t/lib/dbixcsl_common_tests.pm 2009-03-19 00:15:12 UTC (rev 5771)
@@ -43,7 +43,7 @@
sub run_tests {
my $self = shift;
- plan tests => 90;
+ plan tests => 88;
$self->create();
@@ -111,12 +111,10 @@
my $moniker1 = $monikers->{loader_test1};
my $class1 = $classes->{loader_test1};
my $rsobj1 = $conn->resultset($moniker1);
- check_no_duplicate_unique_constraints($class1);
my $moniker2 = $monikers->{loader_test2};
my $class2 = $classes->{loader_test2};
my $rsobj2 = $conn->resultset($moniker2);
- check_no_duplicate_unique_constraints($class2);
my $moniker23 = $monikers->{LOADER_TEST23};
my $class23 = $classes->{LOADER_TEST23};
@@ -505,19 +503,6 @@
}
}
-sub check_no_duplicate_unique_constraints {
- my ($class) = @_;
-
- # unique_constraints() automatically includes the PK, if any
- my %uc_cols;
- ++$uc_cols{ join ", ", @$_ }
- for values %{ { $class->unique_constraints } };
- my $dup_uc = grep { $_ > 1 } values %uc_cols;
-
- is($dup_uc, 0, "duplicate unique constraints ($class)")
- or diag "uc_cols: @{[ %uc_cols ]}";
-}
-
sub dbconnect {
my ($self, $complain) = @_;
More information about the Bast-commits
mailing list