Issue #1869 speed up upgrade script for dropping dataURI.
Former-commit-id:0d34bff004
[formerly 075e1cda11aeeef027a106c50d535fd7cb8adf2e] Former-commit-id:78f56b32b0
This commit is contained in:
parent
dd5b0c4caf
commit
2da0c851f0
1 changed files with 11 additions and 4 deletions
|
@ -48,14 +48,21 @@ dropDatauriAndAddConstraint ldadmesonet ldadmesonet_stationid_reftime_reportType
|
|||
dropDatauriAndAddConstraint qc qc_stationid_reftime_qctype_latitude_longitude_key "(stationid, reftime, qcType, latitude, longitude)"
|
||||
|
||||
# These type need a unique stationid so set one before dropping datauri.
|
||||
${PSQL} -U awips -d metadata -c "update bufrascat set stationid = to_char(longitude, 'FM999.999') || ':' || to_char(latitude, 'FM999.999')"
|
||||
dropDatauriAndAddConstraint bufrascat bufrascat_stationid_reftime_satid_latitude_longitude_key "(stationid, reftime, satid, latitude, longitude)"
|
||||
${PSQL} -U awips -d metadata -c "update bufrssmi set stationid = to_char(longitude, 'FM999.999') || ':' || to_char(latitude, 'FM999.999')"
|
||||
${PSQL} -U awips -d metadata -c "update bufrascat set stationid = to_char(longitude, 'FM999.999') || ':' || to_char(latitude, 'FM999.999')"
|
||||
${PSQL} -U awips -d metadata -c "VACUUM FULL ANALYZE bufrascat"
|
||||
|
||||
dropDatauriAndAddConstraint bufrssmi bufrssmi_stationid_reftime_satid_latitude_longitude_key "(stationid, reftime, satid, latitude, longitude)"
|
||||
${PSQL} -U awips -d metadata -c "update bufrhdw set stationid = to_char(longitude, 'FM999.999') || ':' || to_char(latitude, 'FM999.999')"
|
||||
${PSQL} -U awips -d metadata -c "update bufrssmi set stationid = to_char(longitude, 'FM999.999') || ':' || to_char(latitude, 'FM999.999')"
|
||||
${PSQL} -U awips -d metadata -c "VACUUM FULL ANALYZE bufrssmi"
|
||||
|
||||
dropDatauriAndAddConstraint bufrhdw bufrhdw_stationid_reftime_sattype_pressure_latitude_longitude_key "(stationid, reftime, sattype, pressure, latitude, longitude)"
|
||||
${PSQL} -U awips -d metadata -c "update bufrmthdw set stationid = to_char(longitude, 'FM999.999') || ':' || to_char(latitude, 'FM999.999')"
|
||||
${PSQL} -U awips -d metadata -c "update bufrhdw set stationid = to_char(longitude, 'FM999.999') || ':' || to_char(latitude, 'FM999.999')"
|
||||
${PSQL} -U awips -d metadata -c "VACUUM FULL ANALYZE bufrhdw"
|
||||
|
||||
dropDatauriAndAddConstraint bufrmthdw bufrmthdw_stationid_reftime_sattype_pressure_latitude_longitude_key "(stationid, reftime, sattype, pressure, latitude, longitude)"
|
||||
${PSQL} -U awips -d metadata -c "update bufrmthdw set stationid = to_char(longitude, 'FM999.999') || ':' || to_char(latitude, 'FM999.999')"
|
||||
${PSQL} -U awips -d metadata -c "VACUUM FULL ANALYZE bufrmthdw"
|
||||
|
||||
|
||||
echo "INFO: dataURI columns dropped successfully"
|
||||
|
|
Loading…
Add table
Reference in a new issue