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