X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema%2FLoader%2FDBI%2FDB2.pm;h=3909efd38c384e4eb91cf2a327234306aa32712a;hb=refs%2Ftags%2F0.04999_03;hp=18410e7af8e645ef26401a24fe414b2fea9e559b;hpb=5223f24a6662ce33f7b60d2a3f6f83e83f5373cc;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm b/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm index 18410e7..3909efd 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm @@ -3,8 +3,11 @@ package DBIx::Class::Schema::Loader::DBI::DB2; use strict; use warnings; use base 'DBIx::Class::Schema::Loader::DBI'; +use Carp::Clan qw/^DBIx::Class/; use Class::C3; +our $VERSION = '0.04999_03'; + =head1 NAME DBIx::Class::Schema::Loader::DBI::DB2 - DBIx::Class::Schema::Loader::DBI DB2 Implementation. @@ -14,10 +17,7 @@ DBIx::Class::Schema::Loader::DBI::DB2 - DBIx::Class::Schema::Loader::DBI DB2 Imp package My::Schema; use base qw/DBIx::Class::Schema::Loader/; - __PACKAGE__->loader_options( - relationships => 1, - db_schema => "MYSCHEMA", - ); + __PACKAGE__->loader_options( db_schema => "MYSCHEMA" ); 1; @@ -39,9 +39,9 @@ sub _table_uniq_info { FROM SYSCAT.TABCONST as tc JOIN SYSCAT.KEYCOLUSE as kcu ON tc.CONSTNAME = kcu.CONSTNAME WHERE tc.TABSCHEMA = ? and tc.TABNAME = ? and tc.TYPE = 'U'} - ); + ) or die $DBI::errstr; - $sth->execute($self->db_schema, $table) or die $DBI::errstr; + $sth->execute($self->db_schema, uc $table) or die $DBI::errstr; my %keydata; while(my $row = $sth->fetchrow_arrayref) { @@ -53,11 +53,39 @@ sub _table_uniq_info { @{$keydata{$keyname}}; push(@uniqs, [ $keyname => \@ordered_cols ]); } + $sth->finish; return \@uniqs; } +sub _tables_list { + my $self = shift; + return map lc, $self->next::method; +} + +sub _table_pk_info { + my ($self, $table) = @_; + return $self->next::method(uc $table); +} + +sub _table_fk_info { + my ($self, $table) = @_; + + my $rels = $self->next::method(uc $table); + + foreach my $rel (@$rels) { + $rel->{remote_table} = lc $rel->{remote_table}; + } + + return $rels; +} + +sub _columns_info_for { + my ($self, $table) = @_; + return $self->next::method(uc $table); +} + =head1 SEE ALSO L, L,