3 use dbixcsl_common_tests;
7 my $dsn = $ENV{DBICTEST_ORA_DSN} || '';
8 my $user = $ENV{DBICTEST_ORA_USER} || '';
9 my $password = $ENV{DBICTEST_ORA_PASS} || '';
11 sub _custom_column_info {
14 if ( $info->{TYPE_NAME} eq 'DATE' ){
15 return { timezone => "Europe/Berlin" };
20 my $tester = dbixcsl_common_tests->new(
22 custom_column_info => \&_custom_column_info,
23 auto_inc_pk => 'INTEGER NOT NULL PRIMARY KEY',
25 my ($table, $col) = @_;
27 qq{ CREATE SEQUENCE ${table}_${col}_seq START WITH 1 INCREMENT BY 1},
29 CREATE OR REPLACE TRIGGER ${table}_${col}_trigger
30 BEFORE INSERT ON ${table}
33 SELECT ${table}_${col}_seq.nextval INTO :NEW.${col} FROM dual;
38 auto_inc_drop_cb => sub {
39 my ($table, $col) = @_;
40 return qq{ DROP SEQUENCE ${table}_${col}_seq };
44 password => $password,
47 CREATE TABLE oracle_loader_test1 (
48 id number(5) NOT NULL,
49 name varchar2(100) NOT NULL,
50 create_date date NOT NULL,
51 modification_date date,
55 drop => [qw/ oracle_loader_test1 /],
58 my ( $schema, $monikers, $classes ) = @_;
59 my $rs = $schema->resultset( $monikers->{oracle_loader_test1} );
61 is $rs->result_source->column_info('create_date')->{timezone},
63 'create_date hast timezone';
65 is $rs->result_source->column_info('modification_date')->{timezone},
67 'modification_date hast timezone';
74 if( !$dsn || !$user ) {
75 $tester->skip_tests('You need to set the DBICTEST_ORA_DSN, _USER, and _PASS environment variables');