From 16ccac1f88220ea4be19ebcebd925de077e52f60 Mon Sep 17 00:00:00 2001 From: Elena Mamontova Date: Mon, 17 Oct 2016 10:30:01 +0300 Subject: [PATCH 1/1] Ticket 37. The 'change_policy_timeout' field added. DROP DEFAULT added for the 'change_policy', 'change_policy_timeout'. UPDATE added for the 'change_policy', 'change_policy_timeout'. --- projects/stargazer/inst/var/02-alter-03.sql | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/projects/stargazer/inst/var/02-alter-03.sql b/projects/stargazer/inst/var/02-alter-03.sql index a0199173..d5b2e52e 100644 --- a/projects/stargazer/inst/var/02-alter-03.sql +++ b/projects/stargazer/inst/var/02-alter-03.sql @@ -6,5 +6,11 @@ CREATE DOMAIN DM_TARIFF_CHANGE_POLICY AS VARCHAR(32) NOT NULL CHECK (VALUE IN ('allow', 'to_cheap', 'to_expensive', 'deny')); ALTER TABLE tb_tariffs ADD change_policy DM_TARIFF_CHANGE_POLICY DEFAULT 'allow'; +ALTER TABLE tb_tariffs ADD change_policy_timeout DM_MOMENT DEFAULT '1970-01-01 00:00:00'; + +ALTER TABLE tb_tariffs ALTER COLUMN change_policy DROP DEFAULT; +ALTER TABLE tb_tariffs ALTER COLUMN change_policy_timeout DROP DEFAULT; + +UPDATE tb_tariffs SET change_policy = 'allow', change_policy_timeout = '1970-01-01 00:00:00'; UPDATE tb_info SET version = 2; -- 2.44.2