]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/cats/drop_postgresql_tables.in
Fix segfault when loading Plugins
[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 jobhisto;
15 drop table media;
16 drop table client;
17 drop table pool;
18 drop table fileset;
19 drop table path;
20 drop table filename;
21 drop table counters;
22 drop table version;
23 drop table CDImages;
24 drop table Device;
25 drop table Storage;
26 drop table MediaType;
27 drop table Status;
28 drop table MAC;
29 drop table log;
30 drop table Location;
31 drop table locationlog;
32 drop table PathVisibility;
33 drop table PathHierarchy;
34 END-OF-DATA
35 pstat=$?
36 if test $pstat = 0; 
37 then
38    echo "Deletion of Bacula PostgreSQL tables succeeded."
39 else
40    echo "Deletion of Bacula PostgreSQL tables failed."
41 fi
42 exit $pstat