awips2/deltaScripts/16.2.1/DR4360/alterNPPSoundingRecordDataURI.sh
Roger Ferrel a0600ca767 Omaha #4360 Added missing updates in delta scripts.
Former-commit-id: a8377763ebb8b52dab9fb01372114193809ae3d1
2015-08-17 10:08:36 -05:00

32 lines
944 B
Bash
Executable file

#!/bin/bash
# DR #4360 - this update script will alter the dataURI column from tables derived from NPPSoundingRecord.
PSQL="/awips2/psql/bin/psql"
cmdDir=`dirname $0`
source ${cmdDir}/commonFunctions.sh
# table and constraint names from CrimssRecord and NucapsRecord
tables=("nucaps" "crimss")
# columns from NPPSoundingRecord.
cols=("latitude" "longitude")
echo "INFO: Start update of tables derived from NPPSoundingRecord."
for table in ${tables[@]} ; do
if tableExists ${table} ; then
echo "INFO: Start update of ${table} dataURI columns."
for col in ${cols[@]} ; do
echo "INFO: Update ${table}'s ${col}"
echo ${PSQL} -U awips -d metadata -c "DELETE from ${table} where ${col} is NULL ;"
updateNotNullCol ${table} ${col}
done
echo "INFO: ${table} dataURI columns updated successfully"
else
echo "WARNING: The table ${table} does not exist."
fi
done
echo "INFO: Tables derived from NPPSoundingRecord updated."