]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/cats/drop_postgresql_tables.in
ebl Implement project 2, about new restore menu
[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 END-OF-DATA
33 pstat=$?
34 if test $pstat = 0; 
35 then
36    echo "Deletion of Bacula PostgreSQL tables succeeded."
37 else
38    echo "Deletion of Bacula PostgreSQL tables failed."
39 fi
40 exit $pstat