$target_schema, 'MySQL',
{
no_batch_alters => 1,
- producer_args => { quote_table_names => 0 }
+ producer_args => { quote_identifiers => 0 }
}
);
$out = SQL::Translator::Diff::schema_diff($source_schema, 'MySQL', $target_schema, 'MySQL',
{ ignore_index_names => 1,
ignore_constraint_names => 1,
- producer_args => { quote_table_names => 0 },
+ producer_args => { quote_identifiers => 0 },
});
eq_or_diff($out, <<'## END OF DIFF', "Diff as expected");
my $field = $target_schema->get_table('employee')->get_field('employee_id');
$field->data_type('integer');
$field->size(0);
- $out = SQL::Translator::Diff::schema_diff($schema, 'MySQL', $target_schema, 'MySQL', { producer_args => { quote_table_names => 0 } } );
+ $out = SQL::Translator::Diff::schema_diff($schema, 'MySQL', $target_schema, 'MySQL', { producer_args => { quote_identifiers => 0 } } );
eq_or_diff($out, <<'## END OF DIFF', "No differences found");
-- Convert schema 'create.sql' to 'create2.yml':;
$s2->name('Schema 4');
my $t1 = $s1->add_table(dclone($target_schema->get_table('employee')));
+ $s1->add_table(dclone($source_schema->get_table('deleted')));
my $t2 = dclone($target_schema->get_table('employee'));
$t2->name('fnord');
$t2->extra(renamed_from => 'employee');
DROP FOREIGN KEY bar_fk,
ADD CONSTRAINT foo_fk FOREIGN KEY (employee_id) REFERENCES foo (id);
+ALTER TABLE deleted DROP FOREIGN KEY fk_fake;
+
+DROP TABLE deleted;
+
COMMIT;
# Test quoting works too.
$out = SQL::Translator::Diff::schema_diff($s1, 'MySQL', $s2, 'MySQL',
- { producer_args => { quote_table_names => '`' } }
+ { producer_args => { quote_identifiers => 1 } }
);
eq_or_diff($out, <<'## END OF DIFF', "Quoting can be turned on");
-- Convert schema 'Schema 3' to 'Schema 4':;
BEGIN;
ALTER TABLE `employee` RENAME TO `fnord`,
- DROP FOREIGN KEY bar_fk,
- ADD CONSTRAINT foo_fk FOREIGN KEY (employee_id) REFERENCES `foo` (id);
+ DROP FOREIGN KEY `bar_fk`,
+ ADD CONSTRAINT `foo_fk` FOREIGN KEY (`employee_id`) REFERENCES `foo` (`id`);
+
+ALTER TABLE `deleted` DROP FOREIGN KEY `fk_fake`;
+
+DROP TABLE `deleted`;
COMMIT;