[Bast-commits] r8171 - in branches/DBIx-Class-Schema-Loader/back-compat: . lib/DBIx/Class/Schema lib/DBIx/Class/Schema/Loader lib/DBIx/Class/Schema/Loader/DBI lib/DBIx/Class/Schema/Loader/DBI/ODBC lib/DBIx/Class/Schema/Loader/DBI/Sybase lib/DBIx/Class/Schema/Loader/Manual

caelum at dev.catalyst.perl.org caelum at dev.catalyst.perl.org
Thu Dec 24 12:54:20 GMT 2009


Author: caelum
Date: 2009-12-24 12:54:19 +0000 (Thu, 24 Dec 2009)
New Revision: 8171

Added:
   branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/Manual/
   branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/Manual/UpgradingFromV4.pod
Modified:
   branches/DBIx-Class-Schema-Loader/back-compat/TODO-BACKCOMPAT
   branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader.pm
   branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/Base.pm
   branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI.pm
   branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm
   branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm
   branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm
   branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/ODBC/Microsoft_SQL_Server.pm
   branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm
   branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm
   branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/SQLite.pm
   branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm
   branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/Sybase/Common.pm
   branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/Sybase/Microsoft_SQL_Server.pm
   branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/Writing.pm
   branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm
   branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/RelBuilder.pm
Log:
added Manual/UpgradingFromV4.pod

Modified: branches/DBIx-Class-Schema-Loader/back-compat/TODO-BACKCOMPAT
===================================================================
--- branches/DBIx-Class-Schema-Loader/back-compat/TODO-BACKCOMPAT	2009-12-24 12:32:12 UTC (rev 8170)
+++ branches/DBIx-Class-Schema-Loader/back-compat/TODO-BACKCOMPAT	2009-12-24 12:54:19 UTC (rev 8171)
@@ -1,22 +1,16 @@
 SL Backcompat Plan:
 
-*** dynamic schemas
-
-* should default to 0.04006 mode
-* __PACKAGE__->naming('current') will turn on current mode
-
 *** 0.04006 mode
 
-* use the detector and compat relbuilder ilmari already wrote for static schemas
 * add a loud warning that says that we're running in backcompat mode, and refers
-  to the ::Manual::UpgradingFrom0.04006 POD.
+  to the ::Manual::UpgradingFromV4 POD.
+* preserve custom content from un-singularized Results and delete them when in
+  upgrade mode
 
 *** backcompat tests
 
 Need a comprehensive backcompat.t
 
-*** Write ::Manual::UpgradingFrom0.04006 POD
-
 *** Catalyst Helper
 
 * Add 'upgrade=1' option that upgrades from both old S::L and old helper,

Modified: branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/Base.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/Base.pm	2009-12-24 12:32:12 UTC (rev 8170)
+++ branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/Base.pm	2009-12-24 12:54:19 UTC (rev 8171)
@@ -50,6 +50,7 @@
                                 monikers
                                 dynamic
                                 naming
+                                _upgrading
                              /);
 
 __PACKAGE__->mk_accessors(qw/
@@ -171,10 +172,11 @@
 returns a false value, the code falls back to default behavior
 for that table name.
 
-The default behavior is: C<join '', map ucfirst, split /[\W_]+/, lc $table>,
-which is to say: lowercase everything, split up the table name into chunks
-anywhere a non-alpha-numeric character occurs, change the case of first letter
-of each chunk to upper case, and put the chunks back together.  Examples:
+The default behavior is to singularize the table name, and: C<join '', map
+ucfirst, split /[\W_]+/, lc $table>, which is to say: lowercase everything,
+split up the table name into chunks anywhere a non-alpha-numeric character
+occurs, change the case of first letter of each chunk to upper case, and put
+the chunks back together.  Examples:
 
     Table Name  | Moniker Name
     ---------------------------
@@ -347,7 +349,7 @@
     $self->schema_version_to_dump($DBIx::Class::Schema::Loader::VERSION);
 
     if (not ref $self->naming && defined $self->naming) {
-        my $naming_ver = $self->naming;;
+        my $naming_ver = $self->naming;
         $self->{naming} = {
             relationships => $naming_ver,
             monikers => $naming_ver,
@@ -1134,7 +1136,7 @@
 
 =head1 AUTHOR
 
-See L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
+See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
 
 =head1 LICENSE
 

Modified: branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm	2009-12-24 12:32:12 UTC (rev 8170)
+++ branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm	2009-12-24 12:54:19 UTC (rev 8171)
@@ -134,7 +134,7 @@
 
 =head1 AUTHOR
 
-See L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
+See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
 
 =head1 LICENSE
 

Modified: branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm	2009-12-24 12:32:12 UTC (rev 8170)
+++ branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm	2009-12-24 12:54:19 UTC (rev 8171)
@@ -160,7 +160,7 @@
 
 =head1 AUTHOR
 
-See L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
+See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
 
 =head1 LICENSE
 

Modified: branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/ODBC/Microsoft_SQL_Server.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/ODBC/Microsoft_SQL_Server.pm	2009-12-24 12:32:12 UTC (rev 8170)
+++ branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/ODBC/Microsoft_SQL_Server.pm	2009-12-24 12:54:19 UTC (rev 8171)
@@ -35,7 +35,7 @@
 
 =head1 AUTHOR
 
-See L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
+See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
 
 =head1 LICENSE
 

Modified: branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm	2009-12-24 12:32:12 UTC (rev 8170)
+++ branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm	2009-12-24 12:54:19 UTC (rev 8171)
@@ -51,7 +51,7 @@
 
 =head1 AUTHOR
 
-See L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
+See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
 
 =head1 LICENSE
 

Modified: branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm	2009-12-24 12:32:12 UTC (rev 8170)
+++ branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm	2009-12-24 12:54:19 UTC (rev 8171)
@@ -160,7 +160,7 @@
 
 =head1 AUTHOR
 
-See L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
+See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
 
 =head1 LICENSE
 

Modified: branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm	2009-12-24 12:32:12 UTC (rev 8170)
+++ branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm	2009-12-24 12:54:19 UTC (rev 8171)
@@ -140,7 +140,7 @@
 
 =head1 AUTHOR
 
-See L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
+See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
 
 =head1 LICENSE
 

Modified: branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/SQLite.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/SQLite.pm	2009-12-24 12:32:12 UTC (rev 8170)
+++ branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/SQLite.pm	2009-12-24 12:54:19 UTC (rev 8171)
@@ -202,7 +202,7 @@
 
 =head1 AUTHOR
 
-See L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
+See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
 
 =head1 LICENSE
 

Modified: branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/Sybase/Common.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/Sybase/Common.pm	2009-12-24 12:32:12 UTC (rev 8170)
+++ branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/Sybase/Common.pm	2009-12-24 12:54:19 UTC (rev 8171)
@@ -72,7 +72,7 @@
 
 =head1 AUTHOR
 
-See L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
+See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
 
 =head1 LICENSE
 

Modified: branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/Sybase/Microsoft_SQL_Server.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/Sybase/Microsoft_SQL_Server.pm	2009-12-24 12:32:12 UTC (rev 8170)
+++ branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/Sybase/Microsoft_SQL_Server.pm	2009-12-24 12:54:19 UTC (rev 8171)
@@ -42,7 +42,7 @@
 
 =head1 AUTHOR
 
-See L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
+See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
 
 =head1 LICENSE
 

Modified: branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm	2009-12-24 12:32:12 UTC (rev 8170)
+++ branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm	2009-12-24 12:54:19 UTC (rev 8171)
@@ -251,7 +251,7 @@
 
 =head1 AUTHOR
 
-See L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
+See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
 
 =head1 LICENSE
 

Modified: branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/Writing.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/Writing.pm	2009-12-24 12:32:12 UTC (rev 8170)
+++ branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/Writing.pm	2009-12-24 12:54:19 UTC (rev 8171)
@@ -65,7 +65,7 @@
 
 =head1 AUTHOR
 
-See L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
+See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
 
 =head1 LICENSE
 

Modified: branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm	2009-12-24 12:32:12 UTC (rev 8170)
+++ branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm	2009-12-24 12:54:19 UTC (rev 8171)
@@ -145,7 +145,7 @@
 
 =head1 AUTHOR
 
-See L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
+See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
 
 =head1 LICENSE
 

Modified: branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI.pm	2009-12-24 12:32:12 UTC (rev 8170)
+++ branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/DBI.pm	2009-12-24 12:54:19 UTC (rev 8171)
@@ -300,7 +300,7 @@
 
 =head1 AUTHOR
 
-See L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
+See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
 
 =head1 LICENSE
 

Added: branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/Manual/UpgradingFromV4.pod
===================================================================
--- branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/Manual/UpgradingFromV4.pod	                        (rev 0)
+++ branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/Manual/UpgradingFromV4.pod	2009-12-24 12:54:19 UTC (rev 8171)
@@ -0,0 +1,79 @@
+=pod
+
+=head1 NAME
+
+DBIx::Class::Schema::Loader::Manual::UpgradingFromV4 - Important Information
+Related to Upgrading from Version 0.04006
+
+=head1 What Changed
+
+=over 4
+
+=item *
+
+add_column
+
+The new Loader detects much more information about columns and sets flags like
+C<is_auto_increment> that it didn't set before.
+
+=item *
+
+RelBuilder
+
+The new RelBuilder will give you much nicer accessor names for relationships,
+so you will no longer have conflicts between a foreign key column and the
+relationship accessor itself.
+
+It will also more correctly infer the relationship type, e.g. some relationships
+that were previously detected as a C<has_many> will now be a C<might_have>
+(when the foreign key refers to a unique index.)
+
+=item *
+
+moniker_map
+
+Table names are now singularized when determining the C<Result> class names. So
+the table C<user_roles> would have become C<UserRoles> in C<0.04006> but now
+becomes C<UserRole> instead.
+
+=item *
+
+Support for more databases
+
+We now support Microsoft SQL Server and Sybase, and there are also improvements
+to the other backends.
+
+=back
+
+=head1 Backward Compatibility
+
+In backward compatibility mode, the Loader will use the old relationship names
+and types, and will not singularize monikers for tables.
+
+To control this behavior see L<DBIx::Class::Schema::Loader::Base/naming>.
+
+=head2 Static Schemas
+
+When reading a C<Schema.pm> from a static schema generated with an C<0.04>
+version of Loader, backward compatibility mode willl be turned on, unless
+overridden with the naming accessor.
+
+=head2 Dynamic Schemas
+
+Dynamic schemas will always by default use C<0.04006> mode.
+
+To upgrade a dynamic schema, set the naming accessor (which is proxied to the
+loader) in your C<Schema.pm>:
+
+    __PACKAGE__->naming('current');
+
+=head1 AUTHOR
+
+See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
+
+=head1 LICENSE
+
+This library is free software; you can redistribute it and/or modify it under
+the same terms as Perl itself.
+
+=cut

Modified: branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/RelBuilder.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/RelBuilder.pm	2009-12-24 12:32:12 UTC (rev 8170)
+++ branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/RelBuilder.pm	2009-12-24 12:54:19 UTC (rev 8171)
@@ -262,7 +262,7 @@
 
 =head1 AUTHOR
 
-See L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
+See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
 
 =head1 LICENSE
 

Modified: branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader.pm	2009-12-24 12:32:12 UTC (rev 8170)
+++ branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader.pm	2009-12-24 12:54:19 UTC (rev 8171)
@@ -451,8 +451,12 @@
 ... and lots of other folks. If we forgot you, please write the current
 maintainer or RT.
 
-=head1 LICENSE
+=head1 COPYRIGHT & LICENSE
 
+Copyright (c) 2006 - 2009 by the aforementioned
+L<DBIx::Class::Schema::Loader/AUTHOR> and
+L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
+
 This library is free software; you can redistribute it and/or modify it under
 the same terms as Perl itself.
 




More information about the Bast-commits mailing list