push(@diffs, @diffs_at_end);
if ( @diffs ) {
+ if ( $target_db !~ /^(MySQL|SQLServer|Oracle)$/ ) {
+ unshift(@diffs, "-- Target database $target_db is untested/unsupported!!!");
+ }
return join( "\n",
"-- Convert schema '$src_name' to '$tar_name':\n", @diffs, "\n"
);
: catfile($Bin, "t", @create2);
BEGIN {
- maybe_plan(16,
+ maybe_plan(19,
'SQL::Translator::Parser::SQLite',
'SQL::Translator::Parser::MySQL',
'SQL::Translator::Parser::Oracle',
my $out = `@cmd`;
+like($out, qr/-- Target database SQLite is untested/, "Detected 'untested' comment");
like($out, qr/ALTER TABLE person CHANGE iq/, "Detected altered 'iq' field");
like($out, qr/ALTER TABLE person ADD is_rock_star/,
"Detected missing rock star field");
@cmd = ($sqlt_diff, "$mysql_create1=MySQL", "$mysql_create2=MySQL");
$out = `@cmd`;
+unlike($out, qr/-- Target database MySQL is untested/, "Did not detect 'untested' comment");
like($out, qr/ALTER TABLE person CHANGE person_id/, "Detected altered 'person_id' field");
like($out, qr/ALTER TABLE person CHANGE iq/, "Detected altered 'iq' field");
like($out, qr/ALTER TABLE person CHANGE name/, "Detected altered 'name' field");
@cmd = ($sqlt_diff, "$oracle_create1=Oracle", "$oracle_create2=Oracle");
$out = `@cmd`;
+unlike($out, qr/-- Target database Oracle is untested/, "Did not detect 'untested' comment");
like($out, qr/ALTER TABLE TABLE1 DROP FOREIGN KEY/,
"Detected drop foreign key");
like($out, qr/ALTER TABLE TABLE1 ADD CONSTRAINT/,