=cut
-use constant CURRENT_V => 'v5';
+my $CURRENT_V = 'v5';
-use constant CLASS_ARGS => qw(
+my @CLASS_ARGS = qw(
schema_base_class result_base_class additional_base_classes
left_base_classes additional_classes components resultset_components
);
if ($self->naming) {
for (values %{ $self->naming }) {
- $_ = CURRENT_V if $_ eq 'current';
+ $_ = $CURRENT_V if $_ eq 'current';
}
}
$self->{naming} ||= {};
my ($v) = $real_ver =~ /([1-9])/;
$v = "v$v";
- last if $v eq CURRENT_V || $real_ver =~ /^0\.\d\d999/;
+ last if $v eq $CURRENT_V || $real_ver =~ /^0\.\d\d999/;
if (not %{ $self->naming }) {
warn <<"EOF" unless $ENV{SCHEMA_LOADER_BACKCOMPAT};
my $self = shift;
my $args = shift;
- foreach my $k (CLASS_ARGS) {
+ foreach my $k (@CLASS_ARGS) {
next unless $self->$k;
my @classes = ref $self->$k eq 'ARRAY' ? @{ $self->$k } : $self->$k;
$table_name = lc ( $table_name );
$column_name = lc ( $column_name );
- if ( $table_name eq 'loader_test11'
- and $column_name eq 'loader_test10'
+ if ( $table_name eq 'loader_test35'
+ and $column_name eq 'an_int'
){
return { is_numeric => 1 }
}
);
SKIP: {
- skip $self->{skip_rels}, 96 if $self->{skip_rels};
+ skip $self->{skip_rels}, 99 if $self->{skip_rels};
my $moniker3 = $monikers->{loader_test3};
my $class3 = $classes->{loader_test3};
ok($class10->column_info('loader_test11')->{is_foreign_key}, 'Foreign key detected');
ok($class11->column_info('loader_test10')->{is_foreign_key}, 'Foreign key detected');
- # Added by custom_column_info
- ok($class11->column_info('loader_test10')->{is_numeric}, 'custom_column_info');
-
- is($class36->column_info('a_date')->{locale},'de_DE','datetime_locale');
- is($class36->column_info('a_date')->{timezone},'Europe/Berlin','datetime_timezone');
-
- ok($class36->column_info('b_char_as_data')->{inflate_datetime},'custom_column_info');
- is($class36->column_info('b_char_as_data')->{locale},'de_DE','datetime_locale');
- is($class36->column_info('b_char_as_data')->{timezone},'Europe/Berlin','datetime_timezone');
-
- ok($class36->column_info('c_char_as_data')->{inflate_date},'custom_column_info');
- is($class36->column_info('c_char_as_data')->{locale},'de_DE','datetime_locale');
- is($class36->column_info('c_char_as_data')->{timezone},'Europe/Berlin','datetime_timezone');
-
my $obj10 = $rsobj10->create({ subject => 'xyzzy' });
$obj10->update();
}
}
+ # test custom_column_info and datetime_timezone/datetime_locale
+ {
+ my $class35 = $classes->{loader_test35};
+ my $class36 = $classes->{loader_test36};
+
+ ok($class35->column_info('an_int')->{is_numeric}, 'custom_column_info');
+
+ is($class36->column_info('a_date')->{locale},'de_DE','datetime_locale');
+ is($class36->column_info('a_date')->{timezone},'Europe/Berlin','datetime_timezone');
+
+ ok($class36->column_info('b_char_as_data')->{inflate_datetime},'custom_column_info');
+ is($class36->column_info('b_char_as_data')->{locale},'de_DE','datetime_locale');
+ is($class36->column_info('b_char_as_data')->{timezone},'Europe/Berlin','datetime_timezone');
+
+ ok($class36->column_info('c_char_as_data')->{inflate_date},'custom_column_info');
+ is($class36->column_info('c_char_as_data')->{locale},'de_DE','datetime_locale');
+ is($class36->column_info('c_char_as_data')->{timezone},'Europe/Berlin','datetime_timezone');
+ }
+
# rescan and norewrite test
SKIP: {
my @statements_rescan = (