awips2/deltaScripts/archived/12.5.1/addgfelockindex.sh
Richard Peter c8e373c098 Issue #2854: Reorganize deltaScripts
Former-commit-id: 469c2c597b80fd725f474e0d645656e4054fd69a
2014-04-30 13:03:44 -05:00

28 lines
No EOL
605 B
Bash

#!/bin/bash
# This script will add an index to the gfelocktable table
#
# This needs to be performed with build 12.5.1.
#
PSQL="/awips2/psql/bin/psql"
SQL_COMMAND="CREATE INDEX lock_parmid_idx ON gfelocktable USING btree (parmid);"
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