]> git.stg.codes - stg.git/blob - projects/stargazer/inst/var/02-alter-03.postgresql.sql
Ticket 37. In 'case' where TARIFF::TO_EXPENSIVE, operation '>' changed to '>=' in
[stg.git] / projects / stargazer / inst / var / 02-alter-03.postgresql.sql
1 /*
2  *  DB migration from v02 to v03 (postgres)
3  */
4 BEGIN;
5
6 CREATE DOMAIN DM_TARIFF_CHANGE_POLICY AS TEXT NOT NULL
7     CONSTRAINT valid_value CHECK (VALUE IN ('allow', 'to_cheap', 'to_expensive', 'deny'));
8
9 ALTER TABLE tb_tariffs ADD change_policy DM_TARIFF_CHANGE_POLICY DEFAULT 'allow';
10
11 UPDATE tb_info SET version = 8;
12
13 COMMIT;