2023-06-01 08:45:43 +02:00
|
|
|
#!/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 = 0;
|
|
|
|
|
|
|
|
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,
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2023-06-05 02:18:03 +02:00
|
|
|
$dh->install({version => 1});
|
|
|
|
$dh->upgrade;
|