2 * DB migration from v02 to v03 (firebird)
5 CREATE DOMAIN DM_TARIFF_CHANGE_POLICY AS VARCHAR(32) NOT NULL
6 CHECK (VALUE IN ('allow', 'to_cheap', 'to_expensive', 'deny'));
8 ALTER TABLE tb_tariffs ADD change_policy DM_TARIFF_CHANGE_POLICY DEFAULT 'allow';
9 ALTER TABLE tb_tariffs ADD change_policy_timeout DM_MOMENT DEFAULT '1970-01-01 00:00:00';
11 ALTER TABLE tb_tariffs ALTER COLUMN change_policy DROP DEFAULT;
12 ALTER TABLE tb_tariffs ALTER COLUMN change_policy_timeout DROP DEFAULT;
14 UPDATE tb_tariffs SET change_policy = 'allow', change_policy_timeout = '1970-01-01 00:00:00';
16 UPDATE tb_info SET version = 2;