awips2/deltaScripts/16.1.2/DR4360/alterBufrhdwDataURI.sh
Roger Ferrel 50904b439b Omaha #4360 DataURI changes for table bufrhdw.
Change-Id: I953eed369af679c875a25daeabaca84b2add006e

Former-commit-id: f8c0da8c9aab7eb23352b2d83f2f7ae3b0242cdb
2015-07-16 16:14:46 -05:00

25 lines
755 B
Bash
Executable file

#!/bin/bash
# DR #4360 - this update script will alter the dataURI columns from bufrhdw
PSQL="/awips2/psql/bin/psql"
cmdDir=`dirname $0`
source ${cmdDir}/commonFunctions.sh
table=bufrhdw
# table and constraint names form AScatObs.
echo "INFO: Start update of ${table} dataURI columns."
renameConstraint ${table} uk_${table}_datauri_fields
col=pressure
echo "INFO: Update ${table}'s ${col}"
${PSQL} -U awips -d metadata -c "UPDATE ${table} SET ${col}=-9999 where ${col} is NULL ; "
updateNotNullCol ${table} ${col}
col=satType
echo "Info Update ${table}'s ${col}"
${PSQL} -U awips -d metadata -c "UPDATE ${table} SET ${col}='Null' where ${col} is NULL ; "
updateNotNullCol ${table} ${col}
echo "INFO: ${table} dataURI columns updated successfully"