[Bast-commits] r6441 - in branches/DBIx-Class-Schema-Loader/sybase:
lib/DBIx/Class/Schema/Loader/DBI t/lib
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Wed May 27 08:41:49 GMT 2009
Author: caelum
Date: 2009-05-27 08:41:48 +0000 (Wed, 27 May 2009)
New Revision: 6441
Modified:
branches/DBIx-Class-Schema-Loader/sybase/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm
branches/DBIx-Class-Schema-Loader/sybase/t/lib/dbixcsl_common_tests.pm
Log:
made some progress on Sybase, test is still dying due to a weird exception
Modified: branches/DBIx-Class-Schema-Loader/sybase/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/sybase/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm 2009-05-27 06:32:35 UTC (rev 6440)
+++ branches/DBIx-Class-Schema-Loader/sybase/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm 2009-05-27 08:41:48 UTC (rev 6441)
@@ -111,10 +111,21 @@
my $constraints;
while (my $row = $sth->fetchrow_hashref) {
- my $type = $row->{constraint_type} || '';
- if ($type =~ /^unique/i) {
- my $name = lc $row->{constraint_name};
- push @{$constraints->{$name}}, ( split /,/, lc $row->{constraint_keys} );
+ if (exists $row->{constraint_type}) {
+ my $type = $row->{constraint_type} || '';
+ if ($type =~ /^unique/i) {
+ my $name = lc $row->{constraint_name};
+ push @{$constraints->{$name}},
+ ( split /,/, lc $row->{constraint_keys} );
+ }
+ } else {
+ my $def = $row->{definition} || next;
+ next unless $def =~ /^unique/i;
+ my $name = lc $row->{name};
+ my ($keys) = $def =~ /\((.*)\)/;
+ $keys =~ s/\s*//g;
+ my @keys = map lc, split /,/ => $keys;
+ push @{$constraints->{$name}}, @keys;
}
}
Modified: branches/DBIx-Class-Schema-Loader/sybase/t/lib/dbixcsl_common_tests.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/sybase/t/lib/dbixcsl_common_tests.pm 2009-05-27 06:32:35 UTC (rev 6440)
+++ branches/DBIx-Class-Schema-Loader/sybase/t/lib/dbixcsl_common_tests.pm 2009-05-27 08:41:48 UTC (rev 6441)
@@ -709,15 +709,15 @@
qq{
CREATE TABLE LOADER_TEST23 (
- ID INTEGER NOT NULL PRIMARY KEY,
- DAT VARCHAR(32) NOT NULL UNIQUE
+ id INTEGER NOT NULL PRIMARY KEY,
+ dat VARCHAR(32) NOT NULL UNIQUE
) $self->{innodb}
},
qq{
CREATE TABLE LoAdEr_test24 (
- iD INTEGER NOT NULL PRIMARY KEY,
- DaT VARCHAR(32) NOT NULL UNIQUE
+ id INTEGER NOT NULL PRIMARY KEY,
+ dat VARCHAR(32) NOT NULL UNIQUE
) $self->{innodb}
},
);
@@ -752,7 +752,7 @@
qq{
CREATE TABLE loader_test5 (
id1 INTEGER NOT NULL,
- iD2 INTEGER NOT NULL,
+ id2 INTEGER NOT NULL,
dat VARCHAR(8),
PRIMARY KEY (id1,id2)
) $self->{innodb}
@@ -763,11 +763,11 @@
qq{
CREATE TABLE loader_test6 (
id INTEGER NOT NULL PRIMARY KEY,
- Id2 INTEGER,
+ id2 INTEGER,
loader_test2_id INTEGER,
dat VARCHAR(8),
FOREIGN KEY (loader_test2_id) REFERENCES loader_test2 (id),
- FOREIGN KEY(id,Id2) REFERENCES loader_test5 (id1,iD2)
+ FOREIGN KEY(id,id2) REFERENCES loader_test5 (id1,id2)
) $self->{innodb}
},
@@ -953,7 +953,7 @@
CREATE TABLE loader_test32 (
id INTEGER NOT NULL PRIMARY KEY,
rel1 INTEGER NOT NULL,
- rel2 INTEGER,
+ rel2 INTEGER NULL,
FOREIGN KEY (rel1) REFERENCES loader_test31(id),
FOREIGN KEY (rel2) REFERENCES loader_test31(id)
) $self->{innodb}
@@ -973,7 +973,7 @@
CREATE TABLE loader_test34 (
id INTEGER NOT NULL PRIMARY KEY,
rel1 INTEGER NOT NULL,
- rel2 INTEGER,
+ rel2 INTEGER NULL,
FOREIGN KEY (id,rel1) REFERENCES loader_test33(id1,id2),
FOREIGN KEY (id,rel2) REFERENCES loader_test33(id1,id2)
) $self->{innodb}
More information about the Bast-commits
mailing list