hpr-tools/PostgreSQL_Database/nuke_n_pave.sh

29 lines
578 B
Bash
Raw Normal View History

#!/bin/bash
#
# Script to re-initialise the HPR2 database then rebuild it from the local
# MySQL copy (and ia.db for the IA parts). Also updates shows with multiple
# hosts by adding the missing hosts.
#
#
# Directories
#
BASEDIR="$HOME/HPR/PostgreSQL_Database"
cd "$BASEDIR" || { echo "Failed to cd to $BASEDIR"; exit 1; }
#
# Drops all tables, etc and re-creates them
#
psql -U hpradmin HPR2 < hpr_schema_2.pgsql
#
# Does all phases in order by default
#
./copy_mysql_pg_2 -verb
#
# Adds in all the double hosts we know about at the moment
#
./update_multi-host_shows.sh