awips2/deltaScripts/16.2.2/DR5254/alter_cwa_drop_datauri.sh
Tom Gurney 464bb18971 Omaha #5254 Remove dataURI from CWA plugin
Change-Id: I09cee065bc0607a707f92fb80843e0d4f4b9bc53

Former-commit-id: 051d8e342d6b83045ae85990ab33bdf98d1ecf7c
2016-01-26 10:34:18 -06:00

18 lines
518 B
Bash
Executable file

#!/bin/bash
# DR #5254 - This script drops dataURI column from cwa table and adds a new
# multi-column unique constraint
PSQL="/awips2/psql/bin/psql"
echo "INFO: Altering table cwa"
${PSQL} -U awips -d metadata << EOF
begin transaction;
delete from cwa where eventid is null;
alter table cwa
drop constraint if exists uk_cwa_datauri_fields,
drop column if exists datauri,
alter eventid set not null,
add constraint uk_cwa_datauri_fields unique (reftime, eventid);
commit transaction;
EOF