2023-03-04 22:31:42 +01:00
|
|
|
#!/usr/bin/env perl
|
|
|
|
use v5.36;
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
|
|
|
|
use DBIx::Class::Schema::Loader qw(make_schema_at);
|
|
|
|
use DBIx::Migration;
|
|
|
|
use Mojo::File qw(curfile);
|
|
|
|
|
|
|
|
my $parent = curfile->dirname;
|
|
|
|
my $dsn = "dbi:SQLite:" . $parent->sibling("db", "PoorBooru.db")->to_string;
|
2023-03-05 20:57:20 +01:00
|
|
|
my %opts = (
|
|
|
|
dump_directory => $parent->sibling("lib")->to_string,
|
|
|
|
exclude => qr/^dbix_migration$/,
|
|
|
|
);
|
2023-03-04 22:31:42 +01:00
|
|
|
|
|
|
|
DBIx::Migration->new({
|
|
|
|
dsn => $dsn,
|
|
|
|
dir => $parent->sibling("migrations")->to_string,
|
|
|
|
})->migrate or die "couldn't run migration";
|
|
|
|
|
2023-03-05 20:57:20 +01:00
|
|
|
make_schema_at("PoorBooru::Schema", \%opts, [$dsn]);
|