awips2/deltaScripts/14.4.1/DR3788/updateSatSpatial.sh

14 lines
781 B
Bash
Raw Normal View History

2022-05-05 12:34:50 -05:00
#!/bin/bash
# DR #3788 - this update script will adjust the satellite_spatial to support sequenced gids.
PSQL="/awips2/psql/bin/psql"
echo "INFO: Updating satellite spatial table"
${PSQL} -U awips -d metadata -q -c "delete from satellite_spatial where gid not in (select distinct coverage_gid from satellite)"
${PSQL} -U awips -d metadata -q -c "ALTER TABLE satellite_spatial DROP CONSTRAINT IF EXISTS uk_fdpq7gpkgi3r3k76j83x7axb1"
${PSQL} -U awips -d metadata -c "ALTER TABLE satellite_spatial ADD CONSTRAINT uk_fdpq7gpkgi3r3k76j83x7axb1 UNIQUE (minx, miny, dx, dy, nx, ny, crswkt)"
${PSQL} -U awips -d metadata -c "CREATE SEQUENCE satspatial_seq INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 START 1 CACHE 1;"
echo "INFO: Satellite spatial table successfully updated."