From: Dagfinn Ilmari Mannsåker Date: Thu, 13 Mar 2008 20:45:37 +0000 (+0000) Subject: Default db_schema to the username for DB2 X-Git-Tag: 0.04999_05~13 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7a930e63832f6bf9e999c0184c28ed17d29210f2;p=dbsrgits%2FDBIx-Class-Schema-Loader.git Default db_schema to the username for DB2 --- diff --git a/Changes b/Changes index b8eae02..102bdf5 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,7 @@ Revision history for Perl extension DBIx::Class::Schema::Loader Not yet released - Fix limiting table list to the specified schema for DB2 + - Default db_schema to the username for DB2 0.04999_04 Wed Mar 12, 2008 - Add is_auto_increment detecton for DB2 diff --git a/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm b/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm index 01fbd1c..44c9147 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm @@ -27,6 +27,15 @@ See L. =cut +sub _setup { + my $self = shift; + + $self->next::method(@_); + + my $dbh = $self->schema->storage->dbh; + $self->{db_schema} ||= $dbh->selectrow_array('VALUES(CURRENT_USER)', {}); +} + sub _table_uniq_info { my ($self, $table) = @_; diff --git a/t/13db2_common.t b/t/13db2_common.t index b52fa68..a4dd554 100644 --- a/t/13db2_common.t +++ b/t/13db2_common.t @@ -12,7 +12,6 @@ my $tester = dbixcsl_common_tests->new( dsn => $dsn, user => $user, password => $password, - db_schema => uc $user, ); if( !$dsn || !$user ) {