- Mark foreign key columns with is_foreign_key => 1
- Add support for vendor-specific extra column attributes.
- Add support for extra => { unsigned => 1 } for MySQL.
+ - Add support for enum value lists 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)
$extra_info{is_auto_increment} = 1
}
if ($info->{mysql_type_name} =~ /\bunsigned\b/i) {
- $extra_info{extra} = { unsigned => 1 };
+ $extra_info{extra}{unsigned} = 1;
+ }
+ if ($info->{mysql_values}) {
+ $extra_info{extra}{list} = $info->{mysql_values};
}
return \%extra_info;
create => [
qq{
CREATE TABLE mysql_loader_test1 (
- id INTEGER UNSIGNED NOT NULL PRIMARY KEY
+ id INTEGER UNSIGNED NOT NULL PRIMARY KEY,
+ value ENUM('foo', 'bar', 'baz')
)
},
],
drop => [ qw/ mysql_loader_test1 / ],
- count => 1,
+ count => 3,
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');
+
+ $column_info = $rs->result_source->column_info('value');
+
+ like($column_info->{data_type}, qr/^enum$/i, 'MySQL ENUM type');
+ is_deeply($column_info->{extra}->{list}, [qw/foo bar baz/],
+ 'MySQL ENUM values');
},
}
);