]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/cats/drop_postgresql_tables.in
Backport from BEE
[bacula/bacula] / bacula / src / cats / drop_postgresql_tables.in
1 #!/bin/sh
2 #
3 # shell script to delete Bacula tables for PostgreSQL
4 #
5 #  Bacula® - The Network Backup Solution
6 #
7 #  Copyright (C) 2000-2014 Free Software Foundation Europe e.V.
8 #
9 #  The main author of Bacula is Kern Sibbald, with contributions from many
10 #  others, a complete list can be found in the file AUTHORS.
11 #
12 #  You may use this file and others of this release according to the
13 #  license defined in the LICENSE file, which includes the Affero General
14 #  Public License, v3.0 ("AGPLv3") and some additional permissions and
15 #  terms pursuant to its AGPLv3 Section 7.
16 #
17 #  Bacula® is a registered trademark of Kern Sibbald.
18 #
19
20 bindir=@POSTGRESQL_BINDIR@
21 db_name=@db_name@
22
23 $bindir/psql -f - -d ${db_name} $* <<END-OF-DATA
24 drop table unsavedfiles;
25 drop table basefiles;
26 drop table jobmedia;
27 drop table file;
28 drop table job;
29 drop table jobhisto;
30 drop table media;
31 drop table client;
32 drop table pool;
33 drop table fileset;
34 drop table path;
35 drop table filename;
36 drop table counters;
37 drop table version;
38 drop table CDImages;
39 drop table Device;
40 drop table Storage;
41 drop table MediaType;
42 drop table Status;
43 drop table MAC;
44 drop table log;
45 drop table Location;
46 drop table locationlog;
47 drop table PathVisibility;
48 drop table PathHierarchy;
49 drop table RestoreObject;
50 END-OF-DATA
51 pstat=$?
52 if test $pstat = 0; 
53 then
54    echo "Deletion of Bacula PostgreSQL tables succeeded."
55 else
56    echo "Deletion of Bacula PostgreSQL tables failed."
57 fi
58 exit $pstat