From: Rafael Kitover Date: Thu, 24 Dec 2009 12:54:19 +0000 (+0000) Subject: added Manual/UpgradingFromV4.pod X-Git-Tag: 0.04999_13~23^2~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9cc8e7e177103e568c99f968ff848d25e6c3bea8;p=dbsrgits%2FDBIx-Class-Schema-Loader.git added Manual/UpgradingFromV4.pod --- diff --git a/TODO-BACKCOMPAT b/TODO-BACKCOMPAT index 3321a1f..afb0316 100644 --- a/TODO-BACKCOMPAT +++ b/TODO-BACKCOMPAT @@ -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, diff --git a/lib/DBIx/Class/Schema/Loader.pm b/lib/DBIx/Class/Schema/Loader.pm index d34ed6c..c4c128f 100644 --- a/lib/DBIx/Class/Schema/Loader.pm +++ b/lib/DBIx/Class/Schema/Loader.pm @@ -451,7 +451,11 @@ gugu: Andrey Kostenko ... 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 and +L. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/lib/DBIx/Class/Schema/Loader/Base.pm b/lib/DBIx/Class/Schema/Loader/Base.pm index 2d28c2c..889e429 100644 --- a/lib/DBIx/Class/Schema/Loader/Base.pm +++ b/lib/DBIx/Class/Schema/Loader/Base.pm @@ -50,6 +50,7 @@ __PACKAGE__->mk_ro_accessors(qw/ monikers dynamic naming + _upgrading /); __PACKAGE__->mk_accessors(qw/ @@ -171,10 +172,11 @@ a scalar moniker. If the hash entry does not exist, or the function returns a false value, the code falls back to default behavior for that table name. -The default behavior is: C, -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, 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 @@ sub new { $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 @@ L =head1 AUTHOR -See L. +See L and L. =head1 LICENSE diff --git a/lib/DBIx/Class/Schema/Loader/DBI.pm b/lib/DBIx/Class/Schema/Loader/DBI.pm index 47f5adf..bbe813c 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI.pm @@ -300,7 +300,7 @@ L =head1 AUTHOR -See L. +See L and L. =head1 LICENSE diff --git a/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm b/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm index 6c929eb..c52f3c8 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm @@ -134,7 +134,7 @@ L =head1 AUTHOR -See L. +See L and L. =head1 LICENSE diff --git a/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm b/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm index 7792ba2..f3fb9aa 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm @@ -160,7 +160,7 @@ L =head1 AUTHOR -See L. +See L and L. =head1 LICENSE diff --git a/lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm b/lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm index 26cd879..2d53091 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm @@ -51,7 +51,7 @@ L =head1 AUTHOR -See L. +See L and L. =head1 LICENSE 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 71e744b..7add3fa 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 @@ -35,7 +35,7 @@ L =head1 AUTHOR -See L. +See L and L. =head1 LICENSE diff --git a/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm b/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm index 21e535e..cf5d3f2 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm @@ -160,7 +160,7 @@ L =head1 AUTHOR -See L. +See L and L. =head1 LICENSE diff --git a/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm b/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm index 538c6be..b4876ee 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm @@ -140,7 +140,7 @@ L =head1 AUTHOR -See L. +See L and L. =head1 LICENSE diff --git a/lib/DBIx/Class/Schema/Loader/DBI/SQLite.pm b/lib/DBIx/Class/Schema/Loader/DBI/SQLite.pm index 528de0f..eb8cc2f 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/SQLite.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/SQLite.pm @@ -202,7 +202,7 @@ L =head1 AUTHOR -See L. +See L and L. =head1 LICENSE diff --git a/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm b/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm index 51eb0a3..4a45c86 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm @@ -251,7 +251,7 @@ L =head1 AUTHOR -See L. +See L and L. =head1 LICENSE diff --git a/lib/DBIx/Class/Schema/Loader/DBI/Sybase/Common.pm b/lib/DBIx/Class/Schema/Loader/DBI/Sybase/Common.pm index 5abab4f..d5a7a08 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/Sybase/Common.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/Sybase/Common.pm @@ -72,7 +72,7 @@ L, L, =head1 AUTHOR -See L. +See L and L. =head1 LICENSE 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 91a4e05..b4f620b 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 @@ -42,7 +42,7 @@ L, L, =head1 AUTHOR -See L. +See L and L. =head1 LICENSE diff --git a/lib/DBIx/Class/Schema/Loader/DBI/Writing.pm b/lib/DBIx/Class/Schema/Loader/DBI/Writing.pm index 48d606b..6ad50c1 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/Writing.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/Writing.pm @@ -65,7 +65,7 @@ for examples of these. =head1 AUTHOR -See L. +See L and L. =head1 LICENSE diff --git a/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm b/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm index 71c459f..6e26917 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm @@ -145,7 +145,7 @@ L =head1 AUTHOR -See L. +See L and L. =head1 LICENSE diff --git a/lib/DBIx/Class/Schema/Loader/Manual/UpgradingFromV4.pod b/lib/DBIx/Class/Schema/Loader/Manual/UpgradingFromV4.pod new file mode 100644 index 0000000..c5869aa --- /dev/null +++ b/lib/DBIx/Class/Schema/Loader/Manual/UpgradingFromV4.pod @@ -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 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 will now be a C +(when the foreign key refers to a unique index.) + +=item * + +moniker_map + +Table names are now singularized when determining the C class names. So +the table C would have become C in C<0.04006> but now +becomes C 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. + +=head2 Static Schemas + +When reading a C 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: + + __PACKAGE__->naming('current'); + +=head1 AUTHOR + +See L and L. + +=head1 LICENSE + +This library is free software; you can redistribute it and/or modify it under +the same terms as Perl itself. + +=cut diff --git a/lib/DBIx/Class/Schema/Loader/RelBuilder.pm b/lib/DBIx/Class/Schema/Loader/RelBuilder.pm index 56531c0..1261149 100644 --- a/lib/DBIx/Class/Schema/Loader/RelBuilder.pm +++ b/lib/DBIx/Class/Schema/Loader/RelBuilder.pm @@ -262,7 +262,7 @@ sub generate_code { =head1 AUTHOR -See L. +See L and L. =head1 LICENSE