Change-Id: I09cee065bc0607a707f92fb80843e0d4f4b9bc53 Former-commit-id: 051d8e342d6b83045ae85990ab33bdf98d1ecf7c
18 lines
518 B
Bash
Executable file
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
|