awips2/deltaScripts/16.2.1/DR4360/alterCcfpLocationDataURI.sh
Roger Ferrel 9797c7f2e0 Omaha #4360 Rename delta script's folder.
Change-Id: If551d6c39c7aca761200c1734dc537b912da3f84

Former-commit-id: 8ab4092c6a9059bbab59146f0d4c867d261b8efe
2015-08-04 09:46:56 -05:00

25 lines
694 B
Bash
Executable file

#!/bin/bash
# DR #4360 - this update script will alter tables with the embedded dataURI columns from CcfpLocation
PSQL="/awips2/psql/bin/psql"
cmdDir=`dirname $0`
source ${cmdDir}/commonFunctions.sh
tables=("ccfp")
embedded=CcfpLocation
# DataURI cols from CcfpRecord.
cols=("boxlat" "boxlong")
echo "INFO: Start update of tables with embedded CcfpLocation"
for table in ${tables[@]} ; do
echo "INFO: update ${embedded} columns ${cols[@]} for table ${table}"
for col in ${cols[@]} ; do
${PSQL} -U awips -d metadata -c "DELETE from ${table} where ${col} is NULL ; "
updateNotNullCol ${table} ${col}
done
done
echo "INFO: Tables with embedded CcfpLocation updated successfully"