30 lines
650 B
Perl
30 lines
650 B
Perl
|
#!/usr/bin/env perl
|
||
|
|
||
|
use strict;
|
||
|
use warnings;
|
||
|
use aliased 'DBIx::Class::DeploymentHandler' => 'DH';
|
||
|
use Getopt::Long;
|
||
|
use FindBin;
|
||
|
use lib "$FindBin::Bin/../lib";
|
||
|
use LasTres::Schema;
|
||
|
|
||
|
my $force_overwrite = 1;
|
||
|
|
||
|
unless ( GetOptions( 'force_overwrite!' => \$force_overwrite ) ) {
|
||
|
die "Invalid options";
|
||
|
}
|
||
|
|
||
|
my $schema = LasTres::Schema->Schema;
|
||
|
|
||
|
my $dh = DH->new(
|
||
|
{
|
||
|
schema => $schema,
|
||
|
script_directory => "$FindBin::Bin/../dbicdh",
|
||
|
databases => 'PostgreSQL',
|
||
|
sql_translator_args => { add_drop_table => 0 },
|
||
|
force_overwrite => $force_overwrite,
|
||
|
}
|
||
|
);
|
||
|
|
||
|
$dh->upgrade;
|