Created
January 28, 2020 01:46
-
-
Save jjn1056/5a4c50d5279ca59e90d070fc12980974 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $schema = shift; # ISA DBIx::Class::Schema | |
use SQL::Translator; | |
use SQL::Translator::Diff; | |
my $target_schema = SQL::Translator->new( | |
parser => 'SQL::Translator::Parser::DBIx::Class', | |
parser_args => { | |
dbic_schema => $schema, | |
}, | |
)->translate; | |
my $source_schema = SQL::Translator->new( | |
parser => 'DBI', | |
parser_args => { dsn => $ENV{DBI_DSN} } | |
)->translate; | |
my $diff = SQL::Translator::Diff->new({ | |
output_db => 'PostgreSQL', | |
source_schema => $source_schema, | |
target_schema => $target_schema, | |
})->compute_differences->produce_diff_sql; |
Author
jjn1056
commented
Jan 28, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment