: catfile($Bin, "t", @create2);
BEGIN {
- maybe_plan(14,
+ maybe_plan(16,
'SQL::Translator::Parser::SQLite',
'SQL::Translator::Parser::MySQL',
+ 'SQL::Translator::Parser::Oracle',
);
}
@cmd = ($sqlt_diff, "$create1=SQLite", "$create1=SQLite");
$out = `@cmd`;
-like($out, qr/There were no differences/, "Properly detected no differences");
+like($out, qr/No differences found/, "Properly detected no differences");
my @mysql_create1 = qw(data mysql create.sql);
my @mysql_create2 = qw(data mysql create2.sql);
@cmd = ($sqlt_diff, "$mysql_create1=MySQL", "$mysql_create1=MySQL");
$out = `@cmd`;
-like($out, qr/There were no differences/, "Properly detected no differences");
+like($out, qr/No differences found/, "Properly detected no differences");
+
+my @oracle_create1 = qw(data oracle create.sql);
+my @oracle_create2 = qw(data oracle create2.sql);
+
+my $oracle_create1 = (-d "t")
+ ? catfile($Bin, @oracle_create1)
+ : catfile($Bin, "t", @oracle_create1);
+
+my $oracle_create2 = (-d "t")
+ ? catfile($Bin, @oracle_create2)
+ : catfile($Bin, "t", @oracle_create2);
+
+@cmd = ($sqlt_diff, "$oracle_create1=Oracle", "$oracle_create2=Oracle");
+$out = `@cmd`;
+
+like($out, qr/ALTER TABLE TABLE1 DROP FOREIGN KEY/,
+ "Detected drop foreign key");
+like($out, qr/ALTER TABLE TABLE1 ADD CONSTRAINT/,
+ "Detected add constraint");
--- /dev/null
+ CREATE TABLE USER1.TABLE1
+ ( FIELD_ID NUMBER(19,0) NOT NULL ENABLE,
+ OTHERFIELD NUMBER(19,0) NOT NULL ENABLE,
+ CONSTRAINT FK20072D375BA3E34A FOREIGN KEY (OTHERFIELD)
+ REFERENCES USER1.TABLE2 (ID) ON DELETE CASCADE ENABLE,
+ CONSTRAINT FK_FIELD_ID FOREIGN KEY (FIELD_ID)
+ REFERENCES USER1.TABLE3 (ID) ON DELETE CASCADE ENABLE
+ ) ;
--- /dev/null
+ CREATE TABLE USER1.TABLE1
+ ( FIELD_ID NUMBER(19,0) NOT NULL ENABLE,
+ OTHERFIELD NUMBER(19,0) NOT NULL ENABLE,
+ CONSTRAINT FK_OTHERFIELD FOREIGN KEY (OTHERFIELD)
+ REFERENCES USER1.TABLE2 (ID) ON DELETE CASCADE ENABLE,
+ CONSTRAINT FK_FIELD_ID FOREIGN KEY (FIELD_ID)
+ REFERENCES USER1.TABLE3 (ID) ON DELETE CASCADE ENABLE
+ ) ;