bump $VERSION
[dbsrgits/DBIx-Class-Schema-Loader.git] / lib / DBIx / Class / Schema / Loader / Base.pm
index 1c49a0d..2273d03 100644 (file)
@@ -23,7 +23,7 @@ use File::Slurp 'slurp';
 use DBIx::Class::Schema::Loader::Utils 'split_name';
 require DBIx::Class;
 
-our $VERSION = '0.07000';
+our $VERSION = '0.07001';
 
 __PACKAGE__->mk_group_ro_accessors('simple', qw/
                                 schema
@@ -65,6 +65,7 @@ __PACKAGE__->mk_group_ro_accessors('simple', qw/
                                 datetime_locale
                                 config_file
                                 loader_class
+                                qualify_objects
 /);
 
 
@@ -129,7 +130,7 @@ overwriting a dump made with an earlier version.
 
 The option also takes a hashref:
 
-    naming => { relationships => 'v6', monikers => 'v6' }
+    naming => { relationships => 'v7', monikers => 'v7' }
 
 The keys are:
 
@@ -466,6 +467,11 @@ case-sensitive collation will turn this option on unconditionally.
 Currently the drivers for SQLite, mysql, MSSQL and Firebird/InterBase support
 setting this option.
 
+=head1 qualify_objects
+
+Set to true to prepend the L</db_schema> to table names for C<<
+__PACKAGE__->table >> calls, and to some other things like Oracle sequences.
+
 =head1 METHODS
 
 None of these methods are intended for direct invocation by regular
@@ -1502,7 +1508,12 @@ sub _setup_src_meta {
         $table_name = \ $self->_quote_table_name($table_name);
     }
 
-    $self->_dbic_stmt($table_class,'table',$table_name);
+    my $full_table_name = ($self->qualify_objects ? ($self->db_schema . '.') : '') . (ref $table_name ? $$table_name : $table_name);
+
+    # be careful to not create refs Data::Dump can "optimize"
+    $full_table_name    = \do {"".$full_table_name} if ref $table_name;
+
+    $self->_dbic_stmt($table_class, 'table', $full_table_name);
 
     my $cols = $self->_table_columns($table);
     my $col_info = $self->__columns_info_for($table);