Add author test for whitespace errors and make whitespace more consistent
[dbsrgits/DBIx-Class-Schema-Loader.git] / t / backcompat / 0.04006 / 14ora_common.t
CommitLineData
406a97c2 1use DBIx::Class::Schema::Loader::Optional::Dependencies
2 -skip_all_without => qw(test_backcompat test_rdbms_oracle);
3
9a95164d 4use strict;
f8c2ca5e 5use warnings;
1c94fb11 6use lib qw(t/backcompat/0.04006/lib);
9a95164d 7use dbixcsl_common_tests;
1c94fb11 8use Test::More;
9a95164d 9
10my $dsn = $ENV{DBICTEST_ORA_DSN} || '';
11my $user = $ENV{DBICTEST_ORA_USER} || '';
12my $password = $ENV{DBICTEST_ORA_PASS} || '';
13
406a97c2 14dbixcsl_common_tests->new(
9a95164d 15 vendor => 'Oracle',
16 auto_inc_pk => 'INTEGER NOT NULL PRIMARY KEY',
17 auto_inc_cb => sub {
18 my ($table, $col) = @_;
19 return (
20 qq{ CREATE SEQUENCE ${table}_${col}_seq START WITH 1 INCREMENT BY 1},
494e0205 21 qq{
9a95164d 22 CREATE OR REPLACE TRIGGER ${table}_${col}_trigger
23 BEFORE INSERT ON ${table}
24 FOR EACH ROW
25 BEGIN
26 SELECT ${table}_${col}_seq.nextval INTO :NEW.${col} FROM dual;
27 END;
28 }
29 );
30 },
31 auto_inc_drop_cb => sub {
32 my ($table, $col) = @_;
33 return qq{ DROP SEQUENCE ${table}_${col}_seq };
34 },
35 dsn => $dsn,
36 user => $user,
37 password => $password,
406a97c2 38)->run_tests();