Former-commit-id:09f41a6b31
[formerly56745c942e
] [formerly09f41a6b31
[formerly56745c942e
] [formerlyc8e373c098
[formerly 469c2c597b80fd725f474e0d645656e4054fd69a]]] Former-commit-id:c8e373c098
Former-commit-id:a526600e3e
[formerlye1721cad00
] Former-commit-id:18b4d133c7
18 lines
1.2 KiB
Bash
18 lines
1.2 KiB
Bash
#!/bin/sh
|
|
# This script should be run on dx1 as part of next delivery to update the definitions for
|
|
# the stdtextproducts and practicestdtextproducts tables.
|
|
|
|
psql -U awips -d fxa -c "ALTER TABLE stdtextproducts RENAME COLUMN createtime to reftime;"
|
|
psql -U awips -d fxa -c "ALTER TABLE practicestdtextproducts RENAME COLUMN createtime to reftime;"
|
|
|
|
psql -U awips -d fxa -c "ALTER TABLE stdtextproducts ADD COLUMN inserttime timestamp without time zone;"
|
|
psql -U awips -d fxa -c "ALTER TABLE practicestdtextproducts ADD COLUMN inserttime timestamp without time zone;"
|
|
|
|
psql -U awips -d fxa -c "CREATE INDEX stdtextproductsinserttimeindex ON stdtextproducts USING btree (inserttime);"
|
|
psql -U awips -d fxa -c "CREATE INDEX practicestdtextproductsinserttimeindex ON practicestdtextproducts USING btree (inserttime);"
|
|
|
|
psql -U awips -d fxa -c "UPDATE stdtextproducts SET inserttime = CURRENT_TIMESTAMP AT TIME ZONE 'GMT' WHERE inserttime IS NULL;"
|
|
psql -U awips -d fxa -c "UPDATE practicestdtextproducts SET inserttime = CURRENT_TIMESTAMP AT TIME ZONE 'GMT' WHERE inserttime IS NULL;"
|
|
|
|
psql -U awips -d fxa -c "ALTER TABLE stdtextproducts ALTER COLUMN inserttime SET NOT NULL;"
|
|
psql -U awips -d fxa -c "ALTER TABLE practicestdtextproducts ALTER COLUMN inserttime SET NOT NULL;"
|