]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/cats/drop_postgresql_tables.in
kes Add some additional locking in the cats directory in subroutines
[bacula/bacula] / bacula / src / cats / drop_postgresql_tables.in
1 #!/bin/sh
2 #
3 # shell script to delete Bacula tables for PostgreSQL
4
5 bindir=@SQL_BINDIR@
6 db_name=@db_name@
7
8 $bindir/psql -f - -d ${db_name} $* <<END-OF-DATA
9 drop table unsavedfiles;
10 drop table basefiles;
11 drop table jobmedia;
12 drop table file;
13 drop table job;
14 drop table media;
15 drop table client;
16 drop table pool;
17 drop table fileset;
18 drop table path;
19 drop table filename;
20 drop table counters;
21 drop table version;
22 drop table CDImages;
23 drop table Device;
24 drop table Storage;
25 drop table MediaType;
26 drop table Status;
27 drop table MAC;
28 drop table log;
29 drop table Location;
30 drop table locationlog;
31 END-OF-DATA
32 pstat=$?
33 if test $pstat = 0; 
34 then
35    echo "Deletion of Bacula PostgreSQL tables succeeded."
36 else
37    echo "Deletion of Bacula PostgreSQL tables failed."
38 fi
39 exit $pstat