From 19b1d5971c25819b3ccfe48cac16ff4e2daa6ec4 Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Thu, 14 Nov 2013 21:54:17 +0200 Subject: [PATCH] Added migration scripts for new daily fee algo. --- projects/stargazer/inst/var/01-alter-02.mysql.sql | 5 +++++ .../stargazer/inst/var/01-alter-02.postgresql.sql | 13 +++++++++++++ projects/stargazer/inst/var/01-alter-02.sql | 15 +++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 projects/stargazer/inst/var/01-alter-02.mysql.sql create mode 100644 projects/stargazer/inst/var/01-alter-02.postgresql.sql create mode 100644 projects/stargazer/inst/var/01-alter-02.sql diff --git a/projects/stargazer/inst/var/01-alter-02.mysql.sql b/projects/stargazer/inst/var/01-alter-02.mysql.sql new file mode 100644 index 00000000..c5aea323 --- /dev/null +++ b/projects/stargazer/inst/var/01-alter-02.mysql.sql @@ -0,0 +1,5 @@ +/* + * DB migration from v01 to v02 (mysql) + */ + +ALTER TABLE users ADD DisabledDetailStat INT(3) DEFAULT 0; diff --git a/projects/stargazer/inst/var/01-alter-02.postgresql.sql b/projects/stargazer/inst/var/01-alter-02.postgresql.sql new file mode 100644 index 00000000..ef6a98c6 --- /dev/null +++ b/projects/stargazer/inst/var/01-alter-02.postgresql.sql @@ -0,0 +1,13 @@ +/* + * DB migration from v01 to v02 (postgres) + */ +BEGIN; + +CREATE DOMAIN DM_TARIFF_PERIOD AS TEXT NOT NULL + CONSTRAINT valid_value CHECK (VALUE = 'month' OR VALUE = 'day'); + +ALTER TABLE tb_tariffs ADD period DM_TARIFF_PERIOD DEFAULT 'month'; + +UPDATE tb_info SET version = 7; + +COMMIT; diff --git a/projects/stargazer/inst/var/01-alter-02.sql b/projects/stargazer/inst/var/01-alter-02.sql new file mode 100644 index 00000000..065d1a79 --- /dev/null +++ b/projects/stargazer/inst/var/01-alter-02.sql @@ -0,0 +1,15 @@ +/* + * DB migration from v01 to v02 (firebird) + */ + +CREATE DOMAIN DM_TARIFF_PERIOD AS VARCHAR(32) NOT NULL + CHECK (VALUE = 'month' OR VALUE = 'day'); + +ALTER TABLE tb_tariffs ADD period DM_TARIFF_PERIOD DEFAULT 'month'; + +CREATE TABLE tb_info +( + version INTEGER NOT NULL +); + +INSERT INTO tb_info VALUES (5); -- 2.44.2