From: Rafael Kitover Date: Sat, 27 Mar 2010 18:18:17 +0000 (-0400) Subject: don't set result_namespace if it's 'Result' X-Git-Tag: 0.06000~23 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2a8e93e98aace9a187a57a66a8d71fabc6a48a8c;p=dbsrgits%2FDBIx-Class-Schema-Loader.git don't set result_namespace if it's 'Result' --- diff --git a/Changes b/Changes index 36905f8..0205a37 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,6 @@ Revision history for Perl extension DBIx::Class::Schema::Loader + - don't set result_namespace if it's 'Result' - support for MSSQL databases with case sensitive collation - do not try to detect driver and rebless when used with a custom loader_class diff --git a/lib/DBIx/Class/Schema/Loader.pm b/lib/DBIx/Class/Schema/Loader.pm index f8a8f23..e1508c1 100644 --- a/lib/DBIx/Class/Schema/Loader.pm +++ b/lib/DBIx/Class/Schema/Loader.pm @@ -10,7 +10,7 @@ use Scalar::Util qw/ weaken /; # Always remember to do all digits for the version even if they're 0 # i.e. first release of 0.XX *must* be 0.XX000. This avoids fBSD ports # brain damage and presumably various other packaging systems too -our $VERSION = '0.05003'; +our $VERSION = '0.06000'; __PACKAGE__->mk_group_accessors('inherited', qw/ _loader_args diff --git a/lib/DBIx/Class/Schema/Loader/Base.pm b/lib/DBIx/Class/Schema/Loader/Base.pm index 42f3990..b1036e1 100644 --- a/lib/DBIx/Class/Schema/Loader/Base.pm +++ b/lib/DBIx/Class/Schema/Loader/Base.pm @@ -21,7 +21,7 @@ use Scalar::Util 'looks_like_number'; use File::Slurp 'slurp'; require DBIx::Class; -our $VERSION = '0.05003'; +our $VERSION = '0.06000'; __PACKAGE__->mk_group_ro_accessors('simple', qw/ schema @@ -433,7 +433,7 @@ L. =cut -my $CURRENT_V = 'v5'; +my $CURRENT_V = 'v6'; my @CLASS_ARGS = qw( schema_base_class result_base_class additional_base_classes @@ -646,8 +646,8 @@ Version $real_ver static schema detected, turning on backcompat mode. Set the 'naming' attribute or the SCHEMA_LOADER_BACKCOMPAT environment variable to disable this warning. -See perldoc DBIx::Class::Schema::Loader::Manual::UpgradingFromV4 for more -details. +See perldoc DBIx::Class::Schema::Loader::Manual::UpgradingFromV4 if upgrading +from version 0.04006. EOF } else { @@ -1089,9 +1089,12 @@ sub _dump_to_dir { if ($self->use_namespaces) { $schema_text .= qq|__PACKAGE__->load_namespaces|; my $namespace_options; - for my $attr (qw(result_namespace - resultset_namespace - default_resultset_class)) { + + my @attr = qw/resultset_namespace default_resultset_class/; + + unshift @attr, 'result_namespace' unless (not $self->result_namespace) || $self->result_namespace eq 'Result'; + + for my $attr (@attr) { if ($self->$attr) { $namespace_options .= qq| $attr => '| . $self->$attr . qq|',\n| } diff --git a/lib/DBIx/Class/Schema/Loader/DBI.pm b/lib/DBIx/Class/Schema/Loader/DBI.pm index e5c0332..2eda983 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI.pm @@ -6,7 +6,7 @@ use base qw/DBIx::Class::Schema::Loader::Base/; use Class::C3; use Carp::Clan qw/^DBIx::Class/; -our $VERSION = '0.05003'; +our $VERSION = '0.06000'; =head1 NAME diff --git a/lib/DBIx/Class/Schema/Loader/DBI/Component/QuotedDefault.pm b/lib/DBIx/Class/Schema/Loader/DBI/Component/QuotedDefault.pm index 9c0f289..b71f2ce 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/Component/QuotedDefault.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/Component/QuotedDefault.pm @@ -4,7 +4,7 @@ use strict; use warnings; use Class::C3; -our $VERSION = '0.05003'; +our $VERSION = '0.06000'; =head1 NAME diff --git a/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm b/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm index b3a1c23..9592210 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm @@ -9,7 +9,7 @@ use base qw/ use Carp::Clan qw/^DBIx::Class/; use Class::C3; -our $VERSION = '0.05003'; +our $VERSION = '0.06000'; =head1 NAME diff --git a/lib/DBIx/Class/Schema/Loader/DBI/InterBase.pm b/lib/DBIx/Class/Schema/Loader/DBI/InterBase.pm index b07c656..f200ef3 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/InterBase.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/InterBase.pm @@ -12,7 +12,7 @@ __PACKAGE__->mk_group_ro_accessors('simple', qw/ unquoted_ddl /); -our $VERSION = '0.05003'; +our $VERSION = '0.06000'; =head1 NAME diff --git a/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm b/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm index 8fbba24..71d49d4 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm @@ -10,7 +10,7 @@ __PACKAGE__->mk_group_accessors('simple', qw/ case_sensitive_collation /); -our $VERSION = '0.05003'; +our $VERSION = '0.06000'; =head1 NAME diff --git a/lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm b/lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm index d052e27..a0a979f 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm @@ -6,7 +6,7 @@ use base 'DBIx::Class::Schema::Loader::DBI'; use Carp::Clan qw/^DBIx::Class/; use Class::C3; -our $VERSION = '0.05003'; +our $VERSION = '0.06000'; =head1 NAME diff --git a/lib/DBIx/Class/Schema/Loader/DBI/ODBC/Firebird.pm b/lib/DBIx/Class/Schema/Loader/DBI/ODBC/Firebird.pm index 226d0a5..32975f5 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/ODBC/Firebird.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/ODBC/Firebird.pm @@ -9,7 +9,7 @@ use base qw/ use Carp::Clan qw/^DBIx::Class/; use Class::C3; -our $VERSION = '0.05003'; +our $VERSION = '0.06000'; =head1 NAME diff --git a/lib/DBIx/Class/Schema/Loader/DBI/ODBC/Microsoft_SQL_Server.pm b/lib/DBIx/Class/Schema/Loader/DBI/ODBC/Microsoft_SQL_Server.pm index ebd8fe6..a452d18 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/ODBC/Microsoft_SQL_Server.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/ODBC/Microsoft_SQL_Server.pm @@ -8,7 +8,7 @@ use base qw/ use Carp::Clan qw/^DBIx::Class/; use Class::C3; -our $VERSION = '0.05003'; +our $VERSION = '0.06000'; =head1 NAME diff --git a/lib/DBIx/Class/Schema/Loader/DBI/ODBC/SQL_Anywhere.pm b/lib/DBIx/Class/Schema/Loader/DBI/ODBC/SQL_Anywhere.pm index feb359e..d286704 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/ODBC/SQL_Anywhere.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/ODBC/SQL_Anywhere.pm @@ -8,7 +8,7 @@ use base qw/ use Carp::Clan qw/^DBIx::Class/; use Class::C3; -our $VERSION = '0.05003'; +our $VERSION = '0.06000'; =head1 NAME diff --git a/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm b/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm index 1a92b83..a5bf0af 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm @@ -9,7 +9,7 @@ use base qw/ use Carp::Clan qw/^DBIx::Class/; use Class::C3; -our $VERSION = '0.05003'; +our $VERSION = '0.06000'; =head1 NAME diff --git a/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm b/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm index cee52e2..36ae47d 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm @@ -9,7 +9,7 @@ use base qw/ use Carp::Clan qw/^DBIx::Class/; use Class::C3; -our $VERSION = '0.05003'; +our $VERSION = '0.06000'; =head1 NAME diff --git a/lib/DBIx/Class/Schema/Loader/DBI/SQLAnywhere.pm b/lib/DBIx/Class/Schema/Loader/DBI/SQLAnywhere.pm index 6df0aac..e4380a1 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/SQLAnywhere.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/SQLAnywhere.pm @@ -9,7 +9,7 @@ use base qw/ /; use Carp::Clan qw/^DBIx::Class/; -our $VERSION = '0.05003'; +our $VERSION = '0.06000'; =head1 NAME diff --git a/lib/DBIx/Class/Schema/Loader/DBI/SQLite.pm b/lib/DBIx/Class/Schema/Loader/DBI/SQLite.pm index 7ecda46..b9dd3c3 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/SQLite.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/SQLite.pm @@ -10,7 +10,7 @@ use Carp::Clan qw/^DBIx::Class/; use Text::Balanced qw( extract_bracketed ); use Class::C3; -our $VERSION = '0.05003'; +our $VERSION = '0.06000'; =head1 NAME diff --git a/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm b/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm index 865cb92..0877efa 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm @@ -6,7 +6,7 @@ use base 'DBIx::Class::Schema::Loader::DBI::Sybase::Common'; use Carp::Clan qw/^DBIx::Class/; use Class::C3; -our $VERSION = '0.05003'; +our $VERSION = '0.06000'; =head1 NAME diff --git a/lib/DBIx/Class/Schema/Loader/DBI/Sybase/Common.pm b/lib/DBIx/Class/Schema/Loader/DBI/Sybase/Common.pm index 0278cf4..9bdbc92 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/Sybase/Common.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/Sybase/Common.pm @@ -6,7 +6,7 @@ use base 'DBIx::Class::Schema::Loader::DBI'; use Carp::Clan qw/^DBIx::Class/; use Class::C3; -our $VERSION = '0.05003'; +our $VERSION = '0.06000'; =head1 NAME diff --git a/lib/DBIx/Class/Schema/Loader/DBI/Sybase/Microsoft_SQL_Server.pm b/lib/DBIx/Class/Schema/Loader/DBI/Sybase/Microsoft_SQL_Server.pm index 1aa59a0..a15552b 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/Sybase/Microsoft_SQL_Server.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/Sybase/Microsoft_SQL_Server.pm @@ -6,7 +6,7 @@ use base 'DBIx::Class::Schema::Loader::DBI::MSSQL'; use Carp::Clan qw/^DBIx::Class/; use Class::C3; -our $VERSION = '0.05003'; +our $VERSION = '0.06000'; =head1 NAME diff --git a/lib/DBIx/Class/Schema/Loader/DBI/Writing.pm b/lib/DBIx/Class/Schema/Loader/DBI/Writing.pm index 846e303..9bbdee2 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/Writing.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/Writing.pm @@ -1,7 +1,7 @@ package DBIx::Class::Schema::Loader::DBI::Writing; use strict; -our $VERSION = '0.05003'; +our $VERSION = '0.06000'; # Empty. POD only. diff --git a/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm b/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm index cb1fd37..b649ef9 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm @@ -6,7 +6,7 @@ use base 'DBIx::Class::Schema::Loader::DBI'; use Carp::Clan qw/^DBIx::Class/; use Class::C3; -our $VERSION = '0.05003'; +our $VERSION = '0.06000'; =head1 NAME diff --git a/lib/DBIx/Class/Schema/Loader/RelBuilder.pm b/lib/DBIx/Class/Schema/Loader/RelBuilder.pm index 904e5d1..33562aa 100644 --- a/lib/DBIx/Class/Schema/Loader/RelBuilder.pm +++ b/lib/DBIx/Class/Schema/Loader/RelBuilder.pm @@ -7,7 +7,7 @@ use Carp::Clan qw/^DBIx::Class/; use Lingua::EN::Inflect::Number (); use Lingua::EN::Inflect::Phrase (); -our $VERSION = '0.05003'; +our $VERSION = '0.06000'; =head1 NAME