CONTENTS

NAME

SQL::Translator::Diff - determine differences between two schemas

DESCRIPTION

Takes two input SQL::Translator::Schemas (or SQL files) and produces ALTER statements to make them the same

SNYOPSIS

Simplest usage:

use SQL::Translator::Diff;
my $sql = SQL::Translator::Diff::schema_diff($source_schema, 'MySQL', $target_schema, 'MySQL', $options_hash)

OO usage:

use SQL::Translator::Diff;
my $diff = SQL::Translator::Diff->new({
  output_db     => 'MySQL',
  source_schema => $source_schema,
  target_schema => $target_schema,
  %$options_hash,
})->compute_differences->produce_diff_sql;

OPTIONS

ignore_index_names

Match indexes based on types and fields, ignoring name.

ignore_constraint_names

Match constrains based on types, fields and tables, ignoring name.

output_db

Which producer to use to produce the output.

case_insensitive

Ignore case of table, field, index and constraint names when comparing

no_batch_alters

Produce each alter as a distinct ALTER TABLE statement even if the producer supports the ability to do all alters for a table as one statement.

ignore_missing_methods

If the diff would need a method that is missing from the producer, just emit a comment showing the method is missing, rather than dieing with an error

sqlt_args

Hash of extra arguments passed to "new" in SQL::Translator and the below "PRODUCER FUNCTIONS".

PRODUCER FUNCTIONS

The following producer functions should be implemented for completeness. If any of them are needed for a given diff, but not found, an error will be thrown.

AUTHOR

Original Author(s) unknown.

Refactor/re-write and more comprehensive tests by Ash Berlin ash@cpan.org.

Redevelopment sponsored by Takkle Inc.