]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/cats/update_postgresql_tables.in
Integrate Nicolas' patch for direct DVD support.
[bacula/bacula] / bacula / src / cats / update_postgresql_tables.in
1 #!/bin/sh
2 #
3 # Shell script to update PostgreSQL tables from version 1.34 to 1.35.5
4 #
5 echo " "
6 echo "This script will update a Bacula PostgreSQL database from version 7 to 8"
7 echo "Depending on the size of your database,"
8 echo "this script may take several minutes to run."
9 echo " "
10 bindir=@SQL_BINDIR@
11
12 if $bindir/psql $* -f - <<END-OF-DATA
13 \c bacula
14
15 ALTER TABLE media ADD COLUMN volparts integer;
16 UPDATE media SET volparts=0;
17 ALTER TABLE media ALTER COLUMN volparts SET NOT NULL;
18
19 vacuum;
20
21 END-OF-DATA
22 then
23    echo "Update of Bacula PostgreSQL tables succeeded."
24 else
25    echo "Update of Bacula PostgreSQL tables failed."
26 fi
27 exit 0