]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/cats/drop_mysql_tables.in
Revert to using LGPLv3 for simple scripts
[bacula/bacula] / bacula / src / cats / drop_mysql_tables.in
1 #!/bin/sh
2 #
3 # shell script to delete Bacula tables for MySQL
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=@MYSQL_BINDIR@
21 db_name=@db_name@
22
23 if $bindir/mysql $* <<END-OF-DATA
24 USE ${db_name};
25 DROP TABLE IF EXISTS Filename;
26 DROP TABLE IF EXISTS Path;
27 DROP TABLE IF EXISTS LongName;
28 DROP TABLE IF EXISTS Device;
29 DROP TABLE IF EXISTS Storage;
30 DROP TABLE IF EXISTS MediaType;
31 DROP TABLE IF EXISTS File;
32 DROP TABLE IF EXISTS Client;
33 DROP TABLE IF EXISTS Job;
34 DROP TABLE IF EXISTS JobHisto;
35 DROP TABLE IF EXISTS Media;
36 DROP TABLE IF EXISTS JobMedia;
37 DROP TABLE IF EXISTS Pool;
38 DROP TABLE IF EXISTS MultiVolume;
39 DROP TABLE IF EXISTS FileSave;   
40 DROP TABLE IF EXISTS FileSet;   
41 DROP TABLE IF EXISTS Version;
42 DROP TABLE IF EXISTS Counters;
43 DROP TABLE IF EXISTS BaseFiles;
44 DROP TABLE IF EXISTS UnsavedFiles;
45 DROP TABLE IF EXISTS CDImages;
46 DROP TABLE IF EXISTS Status;
47 DROP TABLE IF EXISTS MAC;
48 DROP TABLE IF EXISTS Log;
49 DROP TABLE IF EXISTS Location;
50 DROP TABLE IF EXISTS LocationLog;
51 DROP TABLE IF EXISTS PathVisibility;
52 DROP TABLE IF EXISTS PathHierarchy;
53 DROP TABLE IF EXISTS RestoreObject;
54 END-OF-DATA
55 then
56    echo "Deletion of ${db_name} MySQL tables succeeded."
57 else
58    echo "Deletion of ${db_name} MySQL tables failed."
59 fi
60 exit 0