awips2/deltaScripts/13.5.2/addBufrmosDataURI.sh
Steve Harris 2d30611c6d 14.1.1-3 baseline
Former-commit-id: a0ba2e1252 [formerly 851f9df229] [formerly 94f24e0d8a] [formerly 5739b4f832 [formerly 94f24e0d8a [formerly cbfd1a2e3f6b0688eb8e95ef0eaec1450b4bfc03]]]
Former-commit-id: 5739b4f832
Former-commit-id: 164f1968b2ad159ca45dcba9ade0490d55b9ed19 [formerly 4a6a209aea]
Former-commit-id: aa59400b67
2013-10-28 10:46:02 -04:00

22 lines
829 B
Bash

#!/bin/bash
# DR #2275 - this script is needd to add the dataURI column back into the
# bufrmosavn and bufrmoshpc tables.
PSQL="/awips2/psql/bin/psql"
${PSQL} -U awips -d metadata -c "ALTER TABLE bufrmosavn ADD COLUMN datauri character varying(255);"
if [ $? -ne 0 ]; then
echo "ERROR: Failed to drop dataURI column for bufrmosavn"
echo "FATAL: The update has failed."
exit 1
fi
${PSQL} -U awips -d metadata -c "ALTER TABLE bufrmoshpc ADD COLUMN datauri character varying(255);"
if [ $? -ne 0 ]; then
echo "ERROR: Failed to add dataURI column for bufrmoshpc"
echo "FATAL: The update has failed."
exit 1
fi
${PSQL} -U awips -d metadata -c "VACUUM FULL ANALYZE bufrmosavn"
${PSQL} -U awips -d metadata -c "VACUUM FULL ANALYZE bufrmoshpc"
echo "INFO: dataURI columns added successfully"