0.04999_01 Not yet released
- Add support for vendor-specific extra column attributes.
+ - Add support for extra => { unsigned => 1 } for MySQL.
- Set join_type => 'LEFT OUTER' for nullable foreign keys
(patch from Bernhard Weißhuhn)
- Set is_auto_increment for auto-increment columns (RT #31473)
return $info->{mysql_is_auto_increment};
}
+sub _column_extra_attr {
+ my ($self, $info) = @_;
+
+ my $extra_attr;
+ if ($info->{mysql_type_name} =~ /\bunsigned\b/i) {
+ $extra_attr->{unsigned} = 1;
+ }
+
+ return $extra_attr;
+}
+
=head1 SEE ALSO
L<DBIx::Class::Schema::Loader>, L<DBIx::Class::Schema::Loader::Base>,
use strict;
use lib qw(t/lib);
use dbixcsl_common_tests;
+use Test::More;
my $dsn = $ENV{DBICTEST_MYSQL_DSN} || '';
my $user = $ENV{DBICTEST_MYSQL_USER} || '';
skip_rels => $test_innodb ? 0 : $skip_rels_msg,
no_inline_rels => 1,
no_implicit_rels => 1,
+ extra => {
+ create => [
+ qq{
+ CREATE TABLE mysql_loader_test1 (
+ id INTEGER UNSIGNED NOT NULL PRIMARY KEY
+ )
+ },
+ ],
+ drop => [ qw/ mysql_loader_test1 / ],
+ count => 1,
+ run => sub {
+ my ($schema, $monikers, $classes) = @_;
+
+ my $rs = $schema->resultset($monikers->{mysql_loader_test1});
+ my $column_info = $rs->result_source->column_info('id');
+
+ is($column_info->{extra}->{unsigned}, 1, 'Unsigned MySQL columns');
+ },
+ }
);
if( !$dsn || !$user ) {