diff options
Diffstat (limited to 'upgrades/dbpatches')
-rw-r--r-- | upgrades/dbpatches/1.1_1.3/mysql/patch.sql | 19 | ||||
-rw-r--r-- | upgrades/dbpatches/1.1_1.3/oracle/patch.sql | 35 | ||||
-rw-r--r-- | upgrades/dbpatches/1.1_1.3/postgresql/patch.sql | 20 |
3 files changed, 74 insertions, 0 deletions
diff --git a/upgrades/dbpatches/1.1_1.3/mysql/patch.sql b/upgrades/dbpatches/1.1_1.3/mysql/patch.sql index 81e19973..544879ee 100644 --- a/upgrades/dbpatches/1.1_1.3/mysql/patch.sql +++ b/upgrades/dbpatches/1.1_1.3/mysql/patch.sql @@ -120,3 +120,22 @@ alter table users_groups_tmp rename users_groups; -- Ger rid of NULLs alter table sysmaps_elements modify label_location int(1) DEFAULT '0' NOT NULL; + +alter table graphs add graphtype int(2) DEFAULT '0' NOT NULL; +alter table items add delay_flex varchar(255) DEFAULT "" NOT NULL; + +-- +-- Table structure for table 'services_times' +-- + +CREATE TABLE services_times ( + timeid int(4) NOT NULL auto_increment, + serviceid int(4) DEFAULT '0' NOT NULL, + type int(2) DEFAULT '0' NOT NULL, + ts_from int(4) DEFAULT '0' NOT NULL, + ts_to int(4) DEFAULT '0' NOT NULL, + note varchar(255) DEFAULT '' NOT NULL, + PRIMARY KEY (timeid), + UNIQUE (serviceid,type,ts_from,ts_to) +) type=InnoDB; + diff --git a/upgrades/dbpatches/1.1_1.3/oracle/patch.sql b/upgrades/dbpatches/1.1_1.3/oracle/patch.sql index e69de29b..159b427e 100644 --- a/upgrades/dbpatches/1.1_1.3/oracle/patch.sql +++ b/upgrades/dbpatches/1.1_1.3/oracle/patch.sql @@ -0,0 +1,35 @@ + +alter table graphs add graphtype number(2) DEFAULT '0' NOT NULL; +alter table items add delay_flex varchar(255) DEFAULT NULL; + +-- +-- Table structure for table 'services_times' +-- + +CREATE TABLE services_times ( + timeid number(10) NOT NULL auto_increment, + serviceid number(10) DEFAULT '0' NOT NULL, + type number(3) DEFAULT '0' NOT NULL, + ts_from number(10) DEFAULT '0' NOT NULL, + ts_to number(10) DEFAULT '0' NOT NULL, + note varchar(255) DEFAULT NULL, + CONSTRAINT services_times_pk PRIMARY KEY (timeid) +) type=InnoDB; + +CREATE INDEX services_times_servicid on services_times (serviceid); +CREATE UNIQUE INDEX services_times_uniq on services_times (serviceid,type,ts_from,ts_to); + +create sequence services_times_timeid +start with 20000 +increment by 1 +nomaxvalue; + +create trigger services_times +before insert on services_times +for each row +begin + if (:new.timeid is null or :new.timeid = 0) then + select services_times_timeid.nextval into :new.timeid from dual; + end if; +end; +/ diff --git a/upgrades/dbpatches/1.1_1.3/postgresql/patch.sql b/upgrades/dbpatches/1.1_1.3/postgresql/patch.sql index e69de29b..b705ba6c 100644 --- a/upgrades/dbpatches/1.1_1.3/postgresql/patch.sql +++ b/upgrades/dbpatches/1.1_1.3/postgresql/patch.sql @@ -0,0 +1,20 @@ + +alter table graphs add graphtype int2 DEFAULT '0' NOT NULL; +alter table items add delay_flex varchar(255) DEFAULT "" NOT NULL; + +-- +-- Table structure for table 'services_times' +-- + +CREATE TABLE services_times ( + timeid serial, + serviceid int4 DEFAULT '0' NOT NULL, + type int2 DEFAULT '0' NOT NULL, + ts_from int4 DEFAULT '0' NOT NULL, + ts_to int4 DEFAULT '0' NOT NULL, + note varchar(255) DEFAULT '' NOT NULL, + PRIMARY KEY (timeid) +) type=InnoDB; + +CREATE UNIQUE INDEX services_times_uniq on services_times (serviceid,type,ts_from,ts_to); + |