CatalystX-Crudite
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
share/starter/script/db_deploy.pl view on Meta::CPAN
#!/usr/bin/env perl
use Modern::Perl '2012';
use FindBin qw($Bin);
use lib "$Bin/../lib";
use <% dist_module %>::Schema;
use <% dist_module %>::Util::Primer qw(prime_database);
my $schema = <% dist_module %>::Schema->connect("dbi:SQLite:dbname=$Bin/../<% dist_file %>.db")
or die "Unable to connect\n";
say "Enter 'Y' to deploy the schema. This will delete all data in <% dist_file %>.db";
chomp(my $ui = <>);
die "Schema deployment aborted.\n" unless $ui eq 'Y';
# Specify the DB version in producer_args that are passed to
# SQL::Translator::Producer::* so they know that it's ok to generate
# "DROP TABLE IF EXISTS" instead of just "DROP TABLE", which would
# produce errors.
$schema->deploy(
{ add_drop_table => 1,
producer_args => { postgres_version => '9.2', sqlite_version => '3.7' }
}
);
prime_database($schema);
view all matches for this distributionview release on metacpan - search on metacpan
( run in 5.057 seconds using v1.00-cache-2.02-grep-82fe00e-cpan-72ae3ad1e6da )