Default db_schema to the username for DB2
[dbsrgits/DBIx-Class-Schema-Loader.git] / lib / DBIx / Class / Schema / Loader / DBI / DB2.pm
index 01fbd1c..44c9147 100644 (file)
@@ -27,6 +27,15 @@ See L<DBIx::Class::Schema::Loader::Base>.
 
 =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) = @_;