awips2/deltaScripts/11.9.0-1/db/create_index.sh
root 9f19e3f712 Initial revision of AWIPS2 11.9.0-7p5
Former-commit-id: 64fa9254b946eae7e61bbc3f513b7c3696c4f54f
2012-01-06 08:55:05 -06:00

28 lines
630 B
Bash

#!/bin/bash
# This script will add an index to warning table for officeid/phensig
#
# This needs to be performed with build 11.9.0-1.
#
PSQL="/awips2/psql/bin/psql"
SQL_COMMAND="CREATE INDEX warning_query_index on warning using btree (officeid, phensig);"
if [ ! -f ${PSQL} ]; then
echo "ERROR: The PSQL executable does not exist - ${PSQL}."
echo "FATAL: Update Failed!"
exit 1
fi
echo ""
echo "Press Enter to perform the updates Ctrl-C to quit."
read done
${PSQL} -U awips -d metadata -c "${SQL_COMMAND}"
if [ $? -ne 0 ]; then
echo "FATAL: Update Failed!"
exit 1
fi
echo "INFO: The update was successfully applied."
exit 0