23 lines
568 B
Perl
23 lines
568 B
Perl
#!/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;
|
|
my %opts = (
|
|
dump_directory => $parent->sibling("lib")->to_string,
|
|
exclude => qr/^dbix_migration$/,
|
|
);
|
|
|
|
DBIx::Migration->new({
|
|
dsn => $dsn,
|
|
dir => $parent->sibling("migrations")->to_string,
|
|
})->migrate or die "couldn't run migration";
|
|
|
|
make_schema_at("PoorBooru::Schema", \%opts, [$dsn]);
|