awips2/deltaScripts/16.2.2/DR5286/alter_tcg_drop_datauri.sh
Tom Gurney 83e4e93f7f Omaha #5286 Drop dataURI column on tcg
Change-Id: I94203de148c242f8289255974e6e1bcde6ea3293

Former-commit-id: d0e5a8bf870f46f4cb2f89359fd813793f312d9a
2016-01-28 15:11:53 -06:00

19 lines
533 B
Bash
Executable file

#!/bin/bash
# DR #5286 - This script drops dataURI column from tcg table and adds a new
# multi-column unique constraint
TABLE=tcg
PSQL="/awips2/psql/bin/psql"
echo "INFO: Altering table ${TABLE}"
${PSQL} -U awips -d metadata << EOF
begin transaction;
alter table ${TABLE}
drop constraint if exists uk_${TABLE}_datauri_fields,
drop column if exists datauri,
add constraint uk_${TABLE}_datauri_fields unique
(reftime, producttype, modelname, latitude, longitude, stationid);
commit transaction;
EOF