X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema%2FLoader%2FBase.pm;h=a576c716a581956f4e4bc2a3bee41d7a477850b9;hb=5c06aa08ab17d9d0e8437a990b5717238deeb8fd;hp=5634bc6b8767c588e04d4e47de3ddd8f7bb5056b;hpb=fcf328c7653af502233df3b9a692f38c36c681ec;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 5634bc6..a576c71 100644 --- a/lib/DBIx/Class/Schema/Loader/Base.pm +++ b/lib/DBIx/Class/Schema/Loader/Base.pm @@ -72,6 +72,8 @@ __PACKAGE__->mk_group_ro_accessors('simple', qw/ loader_class qualify_objects tables + table_comments_table + column_comments_table class_to_table uniq_to_primary quiet @@ -262,8 +264,23 @@ L.) By default POD will be generated for columns and relationships, using database metadata for the text if available and supported. -Reading database metadata (e.g. C) is only -supported for Postgres right now. +Metadata can be stored in two ways. + +The first is that you can create two tables named C and +C respectively. They both need to have columns named +C and C. The second one needs to have a column +named C. Then data stored in these tables will be used as a +source of metadata about tables and comments. + +(If you wish you can change the name of these tables with the parameters +L and L.) + +As a fallback you can use built-in commenting mechanisms. Currently this +is only supported for PostgreSQL and MySQL. To create comments in +PostgreSQL you add statements of the form C. +To create comments in MySQL you add C to the end of the +column or table definition. Note that MySQL restricts the length of comments, +and also does not handle complex Unicode characters properly. Set this to C<0> to turn off all POD generation. @@ -299,6 +316,16 @@ which it will be forced into a separate description section. The default is C<60> +=head2 table_comments_table + +The table to look for comments about tables in. By default C. +See L for details. + +=head2 column_comments_table + +The table to look for comments about columns in. By default C. +See L for details. + =head2 relationship_attrs Hashref of attributes to pass to each generated relationship, listed @@ -783,6 +810,8 @@ sub new { $self->{schema_class} ||= ( ref $self->{schema} || $self->{schema} ); $self->{schema} ||= $self->{schema_class}; + $self->{table_comments_table} ||= 'table_comments'; + $self->{column_comments_table} ||= 'column_comments'; croak "dump_overwrite is deprecated. Please read the" . " DBIx::Class::Schema::Loader::Base documentation"