/usr/bin/mojomojo_update_db.pl is in libmojomojo-perl 1.05+dfsg-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | #!/usr/bin/env perl
=head1 NAME
mojomojo_update_db.pl - DBIC versioning
=head1 AUTHOR
dab
=head1 DESCRIPTION
DBIx Versionning see on catapulse.org http://www.catapulse.org/articles/view/75
=cut
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../lib";
use MojoMojo::Schema;
use Config::JFDI;
use Term::Prompt;
my $jfdi = Config::JFDI->new(name => "MojoMojo");
my $config = $jfdi->get;
my ($dsn, $user, $pass) = @ARGV;
eval {
if (!$dsn) {
($dsn, $user, $pass) =
@{$config->{'Model::DBIC'}->{'connect_info'}};
};
};
if($@){
die "Your DSN line in mojomojo.conf doesn't look like a valid DSN.".
" Add one, or pass it on the command line.";
}
die "No valid Data Source Name (DSN).\n" if !$dsn;
$dsn =~ s/__HOME__/$FindBin::Bin\/\.\./g;
my $version = MojoMojo::Schema->VERSION;
my $schema = MojoMojo::Schema->connect($dsn, $user, $pass) or
die "Failed to connect to database";
$schema->create_ddl_dir(
['SQLite'],
$version > 1 ? $version : undef,
'db/upgrades',
$version ? $version-1 : $version
);
|