Omaha #4360 Cleanup all unique constraint naming now in a single script.

Former-commit-id: a0b96eaea4d8f0ad7368365ca3f89930379023f4
This commit is contained in:
Roger Ferrel 2015-07-29 14:07:20 -05:00
parent eeedba3a2f
commit d4d75d7aab
13 changed files with 9 additions and 20 deletions

View file

@ -8,9 +8,8 @@ cmdDir=`dirname $0`
source ${cmdDir}/commonFunctions.sh source ${cmdDir}/commonFunctions.sh
table=acars table=acars
# table and constraint names form ACARSRecord. # table and constraint names from ACARSRecord.
echo "INFO: Start update of ${table} dataURI columns." echo "INFO: Start update of ${table} dataURI columns."
renameConstraint ${table} uk_${table}_datauri_fields
col=tailNumber col=tailNumber
echo "INFO: Update ${table}' ${col}" echo "INFO: Update ${table}' ${col}"

View file

@ -8,9 +8,8 @@ cmdDir=`dirname $0`
source ${cmdDir}/commonFunctions.sh source ${cmdDir}/commonFunctions.sh
table=bufrmthdw table=bufrmthdw
# table and constraint names form BufrMTHDWObs. # table and constraint names from BufrMTHDWObs.
echo "INFO: Start update of ${table} dataURI columns." echo "INFO: Start update of ${table} dataURI columns."
renameConstraint ${table} uk_${table}_datauri_fields
col=pressure col=pressure
echo "INFO: Update ${table}'s ${col}" echo "INFO: Update ${table}'s ${col}"

View file

@ -14,7 +14,6 @@ cols=("stationId" "latitude" "longitude")
# table and constraint names from BufrMosDataLocation. # table and constraint names from BufrMosDataLocation.
echo "INFO: Start update of ${table} dataURI columns." echo "INFO: Start update of ${table} dataURI columns."
renameConstraint ${table} uk_${table}_datauri_fields
for col in ${cols[@]} ; do for col in ${cols[@]} ; do
echo "INFO: Update ${table}'s ${col}" echo "INFO: Update ${table}'s ${col}"

View file

@ -8,9 +8,8 @@ cmdDir=`dirname $0`
source ${cmdDir}/commonFunctions.sh source ${cmdDir}/commonFunctions.sh
table=bufrascat table=bufrascat
# table and constraint names form AScatObs. # table and constraint names from AScatObs.
echo "INFO: Start update of ${table} dataURI columns." echo "INFO: Start update of ${table} dataURI columns."
renameConstraint ${table} uk_${table}_datauri_fields
col=windSpd col=windSpd
echo "INFO: Update ${table}'s ${col}" echo "INFO: Update ${table}'s ${col}"

View file

@ -8,9 +8,8 @@ cmdDir=`dirname $0`
source ${cmdDir}/commonFunctions.sh source ${cmdDir}/commonFunctions.sh
table=bufrhdw table=bufrhdw
# table and constraint names form AScatObs. # table and constraint names from AScatObs.
echo "INFO: Start update of ${table} dataURI columns." echo "INFO: Start update of ${table} dataURI columns."
renameConstraint ${table} uk_${table}_datauri_fields
col=pressure col=pressure
echo "INFO: Update ${table}'s ${col}" echo "INFO: Update ${table}'s ${col}"

View file

@ -10,7 +10,6 @@ table=bufrssmi
# table and constraint names form BufrMTHDWObs. # table and constraint names form BufrMTHDWObs.
echo "INFO: Start update of ${table} dataURI columns." echo "INFO: Start update of ${table} dataURI columns."
renameConstraint ${table} uk_${table}_datauri_fields
col=satid col=satid
echo "INFO: Update ${table}'s ${col}" echo "INFO: Update ${table}'s ${col}"

View file

@ -10,7 +10,6 @@ table=ccfp
# table and constraint names from CcfpRecord. # table and constraint names from CcfpRecord.
echo "INFO: Start update of ${table} dataURI columns." echo "INFO: Start update of ${table} dataURI columns."
renameConstraint ${table} uk_${table}_datauri_fields
col=producttype col=producttype
echo "INFO: Update ${table}'s ${col}" echo "INFO: Update ${table}'s ${col}"

View file

@ -10,7 +10,6 @@ table=lsr
# table and constraint names form LocalStormReport. # table and constraint names form LocalStormReport.
echo "INFO: Start update of ${table} dataURI columns." echo "INFO: Start update of ${table} dataURI columns."
renameConstraint ${table} uk_${table}_datauri_fields
col=eventtype col=eventtype
echo "Info Update ${table}'s ${col}" echo "Info Update ${table}'s ${col}"
${PSQL} -U awips -d metadata -c "DELETE from ${table} where ${col} is NULL ; " ${PSQL} -U awips -d metadata -c "DELETE from ${table} where ${col} is NULL ; "

View file

@ -10,7 +10,6 @@ table=madis
# table and constraint names from MadisRecord. # table and constraint names from MadisRecord.
echo "INFO: Start update of ${table} dataURI columns." echo "INFO: Start update of ${table} dataURI columns."
renameConstraint ${table} uk_${table}_datauri_fields
col=provider col=provider
echo "Info Update ${table}'s ${col}" echo "Info Update ${table}'s ${col}"
${PSQL} -U awips -d metadata -c "DELETE from ${table} where ${col} is NULL ; " ${PSQL} -U awips -d metadata -c "DELETE from ${table} where ${col} is NULL ; "

View file

@ -10,7 +10,6 @@ table=ldadmesonet
# table and constraint names form AScatObs. # table and constraint names form AScatObs.
echo "INFO: Start update of ${table} dataURI columns." echo "INFO: Start update of ${table} dataURI columns."
renameConstraint ${table} uk_${table}_datauri_fields
col=reportType col=reportType
echo "INFO: Update ${table}'s ${col}" echo "INFO: Update ${table}'s ${col}"

View file

@ -17,7 +17,6 @@ echo "INFO: Start update of tables derived from NPPSoundingRecord."
for table in ${tables[@]} ; do for table in ${tables[@]} ; do
if tableExists ${table} ; then if tableExists ${table} ; then
echo "INFO: Start update of ${table} dataURI columns." echo "INFO: Start update of ${table} dataURI columns."
echo renameConstraint ${table} uk_${table}_datauri_fields
for col in ${cols[@]} ; do for col in ${cols[@]} ; do
echo "INFO: Update ${table}'s ${col}" echo "INFO: Update ${table}'s ${col}"

View file

@ -9,10 +9,11 @@ source ${cmdDir}/commonFunctions.sh
# A table listed here doesn't need changes to any columns or the change # A table listed here doesn't need changes to any columns or the change
# is handled in some other script. # is handled in some other script.
tables=("acarssounding" "binlightning" "bufrncwf" "bufrmosavn" "bufrmoseta" "bufrmosgfs" "bufrmoshpc" tables=("acars" "acarssounding" "binlightning" "bufrncwf" "bufrmos_location" "bufrmosavn" "bufrmoseta" "bufrmosgfs" "bufrmoshpc"
"bufrmoslamp" "bufrmosmrf" "bufrmosngm" "bufrquikscat" "bufrsigwx" "bufrua" "cwa" "cwat" "ffmp" "fog" "bufrmoslamp" "bufrmosmrf" "bufrmosngm" "bufrmthdw" "bufrquikscat" "bufrascat" "bufrhdw" "bufrsigwx" "bufrssmi" "bufrua" "cwa" "cwat" "ffmp" "fog"
"fssobs" "goessounding" "ldad_manual" "ldadhydro" "ldadprofiler" "modelsounding" "obs" "poessounding" "ccfp" "crimss" "fssobs" "goessounding" "ldad_manual" "ldadhydro" "ldadmesonet" "ldadprofiler" "lsr" "madis" "modelsounding"
"profiler" "qc" "sfcobs" "svrwx" "tcg" "tcs") "nucaps" "obs" "poessounding"
"practicewarning" "profiler" "qc" "sfcobs" "svrwx" "tcg" "tcs" "vaa" "warning")
echo "INFO: rename tables unique constraints" echo "INFO: rename tables unique constraints"
for table in ${tables[@]} ; do for table in ${tables[@]} ; do

View file

@ -10,7 +10,6 @@ table=vaa
# table and constraint names from VAARecord. # table and constraint names from VAARecord.
echo "INFO: Start update of ${table} dataURI columns." echo "INFO: Start update of ${table} dataURI columns."
renameConstraint ${table} uk_${table}_datauri_fields
col=advisorynumber col=advisorynumber
echo "INFO: Update ${table}'s ${col}" echo "INFO: Update ${table}'s ${col}"