source: trunk/LATMOS-Accounts/bin/la-sql-upgrade @ 2380

Last change on this file since 2380 was 2256, checked in by nanardon, 5 years ago

Add attrbiute to add/remove user to autoFiltred group and aliases

File size: 996 bytes
Line 
1#!/usr/bin/perl
2
3use strict;
4use warnings;
5use LATMOS::Accounts;
6use Getopt::Long;
7use Pod::Usage;
8
9my $DATADIR = '@DATADIR@';
10
11=head1 NAME
12
13    la-sql-upgrade - Update SQL base schema
14
15=head1 SYNOPSIS
16
17    la-sql-upgrade [options] [name]
18
19=cut
20
21GetOptions(
22    'c|config=s'     => \my $config,
23    'b|base=s'       => \my $base,
24    'no-commit'      => \my $nocommit,
25    'v|verbose'      => \my $verbose,
26    'h|help'         => sub { pod2usage(1); },
27) or pod2usage();
28
29=head1 OPTIONS
30
31=over 4
32
33=item -c|--config configdir
34
35Use this configuration directory instead of the default one.
36
37=item -b|--base basename
38
39Query this specific base instead of the default one.
40
41=back
42
43=cut
44
45$| = 1; # autoflush
46
47if ($nocommit) {
48    $ENV{LA_NO_COMMIT} = 1;
49}
50
51my $LA = LATMOS::Accounts->new($config, noacl => 1);
52
53$base ||= $LA->default_base_name;
54
55my $labase = $LA->_load_base($base);
56$labase->unexported(1);
57
58$labase->SchemaUpgrade() or die "An error occur";
59
60print "Process terminated successfully\n";
Note: See TracBrowser for help on using the repository browser.