1use strict; 2use lib qw(t/backcompat/0.04006/lib); 3use dbixcsl_common_tests; 4use Test::More; 5plan skip_all => 'set SCHEMA_LOADER_TESTS_BACKCOMPAT to enable these tests' 6 unless $ENV{SCHEMA_LOADER_TESTS_BACKCOMPAT}; 7 8 9my $dsn = $ENV{DBICTEST_ORA_DSN} || ''; 10my $user = $ENV{DBICTEST_ORA_USER} || ''; 11my $password = $ENV{DBICTEST_ORA_PASS} || ''; 12 13my $tester = dbixcsl_common_tests->new( 14 vendor => 'Oracle', 15 auto_inc_pk => 'INTEGER NOT NULL PRIMARY KEY', 16 auto_inc_cb => sub { 17 my ($table, $col) = @_; 18 return ( 19 qq{ CREATE SEQUENCE ${table}_${col}_seq START WITH 1 INCREMENT BY 1}, 20 qq{ 21 CREATE OR REPLACE TRIGGER ${table}_${col}_trigger 22 BEFORE INSERT ON ${table} 23 FOR EACH ROW 24 BEGIN 25 SELECT ${table}_${col}_seq.nextval INTO :NEW.${col} FROM dual; 26 END; 27 } 28 ); 29 }, 30 auto_inc_drop_cb => sub { 31 my ($table, $col) = @_; 32 return qq{ DROP SEQUENCE ${table}_${col}_seq }; 33 }, 34 dsn => $dsn, 35 user => $user, 36 password => $password, 37); 38 39if( !$dsn || !$user ) { 40 $tester->skip_tests('You need to set the DBICTEST_ORA_DSN, _USER, and _PASS environment variables'); 41} 42else { 43 $tester->run_tests(); 44} 45