Omaha #4347 Adding delta script for change to HS productData table.
Change-Id: I8a322ac1ba5784faec7b4567b97791302907473e Former-commit-id: 594812ef1bd43a898e3ca48c1a8055b0399a9a42
This commit is contained in:
parent
963f457d65
commit
1c1636971d
1 changed files with 24 additions and 0 deletions
24
deltaScripts/16.1.1/DR4347/updateProductDataTable.sh
Normal file
24
deltaScripts/16.1.1/DR4347/updateProductDataTable.sh
Normal file
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
# DR #4347 - rename the startTime column to issueTime in the productData table.
|
||||
|
||||
PSQL="/awips2/psql/bin/psql"
|
||||
|
||||
ADDTABLE="
|
||||
DO \$\$
|
||||
BEGIN
|
||||
ALTER TABLE IF EXISTS productData ADD COLUMN issuetime timestamp;
|
||||
EXCEPTION
|
||||
WHEN duplicate_column THEN RAISE INFO 'column issuetime already exists in productData.';
|
||||
END;
|
||||
\$\$
|
||||
"
|
||||
|
||||
echo "INFO: removing productData starttime column"
|
||||
|
||||
${PSQL} -U awips -d metadata -q -c "ALTER TABLE IF EXISTS productData DROP COLUMN IF EXISTS starttime;"
|
||||
|
||||
echo "INFO: adding productData issuetime column"
|
||||
|
||||
${PSQL} -U awips -d metadata -q -c "${ADDTABLE}"
|
||||
|
||||
echo "Done."
|
Loading…
Add table
Reference in a new issue