From: Dagfinn Ilmari Mannsåker Date: Sun, 27 Jan 2008 08:58:38 +0000 (+0000) Subject: Add support for vendor-specific extra column attributes. X-Git-Tag: 0.04999_01~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c5baf1311f0c3f5dc3c12197190b41205989c11d;p=dbsrgits%2FDBIx-Class-Schema-Loader.git Add support for vendor-specific extra column attributes. --- diff --git a/Changes b/Changes index 3be42af..455a4a0 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ Revision history for Perl extension DBIx::Class::Schema::Loader 0.04999_01 Not yet released + - Add support for vendor-specific extra column attributes. - Set join_type => 'LEFT OUTER' for nullable foreign keys (patch from Bernhard Weißhuhn) - Set is_auto_increment for auto-increment columns (RT #31473) diff --git a/lib/DBIx/Class/Schema/Loader/DBI.pm b/lib/DBIx/Class/Schema/Loader/DBI.pm index 347a7e5..d29f8e7 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI.pm @@ -226,6 +226,10 @@ sub _columns_info_for { $column_info{is_auto_increment} = 1; } + if (my $extra = $self->_column_extra_attr($info)) { + $column_info{extra} = $extra; + } + $result{$col_name} = \%column_info; } $sth->finish; @@ -255,6 +259,10 @@ sub _columns_info_for { $column_info{is_auto_increment} = 1; } + if (my $extra = $self->_column_extra_attr($table, $columns[$i], $sth, $i)) { + $column_info{extra} = $extra; + } + $result{$columns[$i]} = \%column_info; } $sth->finish; @@ -277,6 +285,9 @@ sub _columns_info_for { # auto-incremented sub _column_is_auto_increment {} +# Override this in vendor class to return any "extra" column attributes +sub _column_extra_attr {} + =head1 SEE ALSO L