]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
BEE Backport bacula/src/cats/drop_postgresql_tables.in
authorKern Sibbald <kern@sibbald.com>
Tue, 12 May 2020 08:15:13 +0000 (10:15 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 29 Apr 2021 08:44:17 +0000 (10:44 +0200)
This commit is the result of the squash of the following main commits:

Author: Kern Sibbald <kern@sibbald.com>
Date:   Wed Jan 15 21:09:31 2020 +0100

    Use if exists on dropping all postgresql tables

bacula/src/cats/drop_postgresql_tables.in

index 80c3bef151d6af21aa14521722ab6be4cc452cc7..f33db1270bab6c7a422ad353991935b66a146494 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Copyright (C) 2000-2015 Kern Sibbald
+# Copyright (C) 2000-2020 Kern Sibbald
 # License: BSD 2-Clause; see file LICENSE-FOSS
 #
 # shell script to delete Bacula tables for PostgreSQL
@@ -9,9 +9,11 @@ bindir=@POSTGRESQL_BINDIR@
 db_name=@db_name@
 
 $bindir/psql -f - -d ${db_name} $* <<END-OF-DATA 1>/dev/null 2>/dev/null
+drop table if exists Events;
 drop table if exists unsavedfiles;
 drop table if exists basefiles;
 drop table if exists jobmedia;
+drop table if exists filemedia;
 drop table if exists file;
 drop table if exists job;
 drop table if exists jobhisto;
@@ -20,7 +22,6 @@ drop table if exists client;
 drop table if exists pool;
 drop table if exists fileset;
 drop table if exists path;
-drop table if exists filename;
 drop table if exists counters;
 drop table if exists version;
 drop table if exists CDImages;