X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema%2FLoader%2FBase.pm;h=2273d03cd0e776a657760c753c2976173824e968;hb=6b1d4f76b756e4b4119153a1f1e8a7bd59ad4e87;hp=1c49a0da13af321abbedee4c821330583e0b35ff;hpb=b511f36e7550cfe8aac546be689c8bd320a83975;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/lib/DBIx/Class/Schema/Loader/Base.pm b/lib/DBIx/Class/Schema/Loader/Base.pm index 1c49a0d..2273d03 100644 --- a/lib/DBIx/Class/Schema/Loader/Base.pm +++ b/lib/DBIx/Class/Schema/Loader/Base.pm @@ -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 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);