From: Brandon Black Date: Mon, 5 Jun 2006 18:57:49 +0000 (+0000) Subject: warns about C::M::DBIC::Schema upgrading / regenerating X-Git-Tag: 0.03001~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8f9d7ce50bb37fdc2a823b9c79b18fb32ee5f068;p=dbsrgits%2FDBIx-Class-Schema-Loader.git warns about C::M::DBIC::Schema upgrading / regenerating numerous tiny pod fixes --- diff --git a/Changes b/Changes index b3f0ed7..653ed6d 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,9 @@ Revision history for Perl extension DBIx::Class::Schema::Loader 0.03001 XXX not yet released + - load_from_connection deprecation notice now mentions + upgrading Catalyst::Model::DBIC::Schema if that module + seems to be in use. - DBIx::Class required version number fixed - Loader statement caching for better load-time performance - Improved Pg unique index loader, based on RDBO diff --git a/lib/DBIx/Class/Schema/Loader.pm b/lib/DBIx/Class/Schema/Loader.pm index 20ee8ff..50d9dd9 100644 --- a/lib/DBIx/Class/Schema/Loader.pm +++ b/lib/DBIx/Class/Schema/Loader.pm @@ -49,7 +49,7 @@ L by scanning database table definitions and setting up the columns and primary keys. DBIx::Class::Schema::Loader currently supports DBI for MySQL, -Postgres, SQLite and DB2. +PostgreSQL, SQLite and DB2. See L for notes on writing your own vendor-specific subclass for an unsupported DBD driver. @@ -229,7 +229,7 @@ sub import { This simple function allows one to create a Loader-based schema in-memory on the fly without any on-disk class files of any kind. When used with the C option, you can -use this to generate a rought draft manual schema from a dsn +use this to generate a rough draft manual schema from a dsn without the intermediate step of creating a physical Loader-based schema class. @@ -303,7 +303,7 @@ will issue warnings about your usage of deprecated features/methods. This deprecated method is now roughly an alias for L. -This method *will* dissappear in a future version. +This method *will* disappear in a future version. For now, using this method will invoke the legacy behavior for backwards compatibility, and merely emit a warning about upgrading @@ -323,8 +323,18 @@ See the source of this method for more details. sub load_from_connection { my ($self, %args) = @_; + + my $cmds_ver = $Catalyst::Model::DBIC::Schema::VERSION; + if($cmds_ver) { + if($cmds_ver < 0.14) { + warn 'You should upgrade your installation of' + . ' Catalyst::Model::DBIC::Schema to 0.14 or higher, then:'; + } + warn 'You should regenerate your Model files, which may eliminate' + . ' the following deprecation warning:'; + } warn 'load_from_connection deprecated, please [re-]read the' - . ' [new] DBIx::Class::Schema::Loader documentation'; + . ' [new] DBIx::Class::Schema::Loader documentation'; # Support the old connect_info / dsn / etc args... $args{connect_info} = [ @@ -355,7 +365,7 @@ for doing so. If you're already using C in your code, make an effort to get rid of it. If you think you've found a situation where it -is neccesary, let me know and we'll see what we can do to remedy +is necessary, let me know and we'll see what we can do to remedy that situation. In some future version, this accessor *will* disappear. It was @@ -369,7 +379,7 @@ user-land in the first place, all things considered. Currently the loader is limited to working within a single schema (using the database vendors' definition of "schema"). If you have a multi-schema database with inter-schema relationships (which -is easy to do in Postgres or DB2 for instance), you only get to +is easy to do in PostgreSQL or DB2 for instance), you only get to automatically load the tables of one schema, and any relationships to tables in other schemas will be silently ignored. diff --git a/lib/DBIx/Class/Schema/Loader/Base.pm b/lib/DBIx/Class/Schema/Loader/Base.pm index a7397c3..53ea95e 100644 --- a/lib/DBIx/Class/Schema/Loader/Base.pm +++ b/lib/DBIx/Class/Schema/Loader/Base.pm @@ -74,8 +74,8 @@ Exclude tables matching regex. Best specified as a qr// regex. =head2 moniker_map -Overrides the default tablename -> moniker translation. Can be either -a hashref of table => moniker names, or a coderef for a translator +Overrides the default table name to moniker translation. Can be either +a hashref of table keys and moniker values, or a coderef for a translator function taking a single scalar table name argument and returning a scalar moniker. If the hash entry does not exist, or the function returns a false value, the code falls back to default behavior @@ -124,7 +124,7 @@ classes. A good example would be C. =head2 resultset_components -List of additional resultset components to be loaded into your table +List of additional ResultSet components to be loaded into your table classes. A good example would be C. Component C will be automatically added to the above C list if this option is set. @@ -132,8 +132,8 @@ C list if this option is set. =head2 legacy_default_inflections Setting this option changes the default fallback for L to -utilize L, and L to a no-op. -Those choices produce substandard results, but might be neccesary to support +utilize L, and L to a no-op. +Those choices produce substandard results, but might be necessary to support your existing code if you started developing on a version prior to 0.03 and don't wish to go around updating all your relationship names to the new defaults. @@ -156,7 +156,7 @@ where that class is currently located, it will overwrite itself with a manual version of itself. This might be a really good or bad thing depending on your situation and perspective. -Normally you wouldn't hardcode this setting in your schema class, as it +Normally you wouldn't hard-code this setting in your schema class, as it is meant for one-time manual usage. See L for examples of the @@ -578,7 +578,7 @@ sub _raw_stmt { =head2 monikers -Returns a hashref of loaded table-to-moniker mappings. There will +Returns a hashref of loaded table to moniker mappings. There will be two entries for each table, the original name and the "normalized" name, in the case that the two are different (such as databases that like uppercase table names, or preserve your original mixed-case @@ -586,7 +586,7 @@ definitions, or what-have-you). =head2 classes -Returns a hashref of table-to-classname mappings. In some cases it will +Returns a hashref of table to class mappings. In some cases it will contain multiple entries per table for the original and normalized table names, as above in L. diff --git a/lib/DBIx/Class/Schema/Loader/DBI.pm b/lib/DBIx/Class/Schema/Loader/DBI.pm index 04cd305..aee9314 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI.pm @@ -110,7 +110,7 @@ sub _table_pk_info { # Override this for uniq info sub _table_uniq_info { - warn "No UNIQUE information can be gathered for this vendor"; + warn "No UNIQUE constraint information can be gathered for this vendor"; return []; } diff --git a/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm b/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm index 08ddca8..a2ddb28 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm @@ -7,7 +7,8 @@ use Class::C3; =head1 NAME -DBIx::Class::Schema::Loader::DBI::Pg - DBIx::Class::Schema::Loader::DBI Postgres Implementation. +DBIx::Class::Schema::Loader::DBI::Pg - DBIx::Class::Schema::Loader::DBI +PostgreSQL Implementation. =head1 SYNOPSIS @@ -79,7 +80,7 @@ sub _table_uniq_info { } if(!@col_names) { - warn "Failed to parse unique constraint $indexname on $table"; + warn "Failed to parse UNIQUE constraint $indexname on $table"; } else { push(@uniqs, [ $indexname => \@col_names ]); diff --git a/lib/DBIx/Class/Schema/Loader/RelBuilder.pm b/lib/DBIx/Class/Schema/Loader/RelBuilder.pm index 10099e1..faeb4b0 100644 --- a/lib/DBIx/Class/Schema/Loader/RelBuilder.pm +++ b/lib/DBIx/Class/Schema/Loader/RelBuilder.pm @@ -66,7 +66,7 @@ the source class, like: ], # ... } - + You might want to use this in building an on-disk source class file, by adding each string to the appropriate source class file, prefixed by C<__PACKAGE__-E>.