X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema%2FLoader%2FDBI%2FMSSQL.pm;h=2bec915fcd3c73a33f1f95941c658c136af8e339;hb=1bcb47d3c20055e9c5d9fe522b3ddd1a7f1bbec9;hp=3409bf700e710beb930e606978252b0ecd2e75ab;hpb=fe67d3434ad62ea06e1a483429cb07c744d6c70d;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm b/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm index 3409bf7..2bec915 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm @@ -2,11 +2,14 @@ package DBIx::Class::Schema::Loader::DBI::MSSQL; use strict; use warnings; -use base 'DBIx::Class::Schema::Loader::DBI'; +use base qw/ + DBIx::Class::Schema::Loader::DBI + DBIx::Class::Schema::Loader::DBI::Sybase::Common +/; use Carp::Clan qw/^DBIx::Class/; use Class::C3; -our $VERSION = '0.04999_06'; +our $VERSION = '0.04999_08'; =head1 NAME @@ -31,7 +34,8 @@ sub _setup { my $self = shift; $self->next::method(@_); - $self->{db_schema} ||= 'dbo'; + $self->{db_schema} ||= $self->_build_db_schema; + $self->_set_quote_char_and_name_sep; } sub _table_pk_info { @@ -43,7 +47,7 @@ sub _table_pk_info { my @keydata; while (my $row = $sth->fetchrow_hashref) { - push @keydata, lc $row->{COLUMN_NAME}; + push @keydata, lc $row->{COLUMN_NAME}; } return \@keydata; @@ -58,18 +62,18 @@ sub _table_fk_info { $sth->execute; while (my $row = $sth->fetchrow_hashref) { - my $fk = $row->{FK_NAME}; - push @{$local_cols->{$fk}}, lc $row->{FKCOLUMN_NAME}; - push @{$remote_cols->{$fk}}, lc $row->{PKCOLUMN_NAME}; - $remote_table->{$fk} = $row->{PKTABLE_NAME}; + my $fk = $row->{FK_NAME}; + push @{$local_cols->{$fk}}, lc $row->{FKCOLUMN_NAME}; + push @{$remote_cols->{$fk}}, lc $row->{PKCOLUMN_NAME}; + $remote_table->{$fk} = $row->{PKTABLE_NAME}; } foreach my $fk (keys %$remote_table) { - push @rels, { - local_columns => \@{$local_cols->{$fk}}, - remote_columns => \@{$remote_cols->{$fk}}, - remote_table => $remote_table->{$fk}, - }; + push @rels, { + local_columns => \@{$local_cols->{$fk}}, + remote_columns => \@{$remote_cols->{$fk}}, + remote_table => $remote_table->{$fk}, + }; } return \@rels; @@ -125,6 +129,10 @@ L Justin Hunter C +=head1 CONTRIBUTORS + +Rafael Kitover + =cut 1;