From: Rafael Kitover Date: Thu, 2 Jul 2009 04:39:37 +0000 (+0000) Subject: merging in sybase branch X-Git-Tag: 0.04999_08~2^2~13 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1e1839d194d3713344fa716408b4fcf351396b48;p=dbsrgits%2FDBIx-Class-Schema-Loader.git merging in sybase branch --- diff --git a/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm b/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm index e45a946..995c561 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm @@ -45,6 +45,12 @@ sub _rebless { bless $self, $subclass; $self->_rebless; } + } else { + $self->schema->storage->sql_maker->quote_char([qw/[ ]/]) + unless $self->schema->storage->sql_maker->quote_char; + + $self->schema->storage->sql_maker->name_sep('.') + unless $self->schema->storage->sql_maker->name_sep; } } @@ -111,10 +117,21 @@ sub _table_uniq_info { 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; } } diff --git a/t/15sybase_common.t b/t/15sybase_common.t index 4995752..f0e5f4c 100644 --- a/t/15sybase_common.t +++ b/t/15sybase_common.t @@ -8,7 +8,6 @@ my $password = $ENV{DBICTEST_SYBASE_PASS} || ''; my $tester = dbixcsl_common_tests->new( vendor => 'Sybase', - quote_char => [qw/[ ]/], auto_inc_pk => 'INTEGER IDENTITY NOT NULL PRIMARY KEY', dsn => $dsn, user => $user,