summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--create/postgresql/schema.sql29
-rw-r--r--upgrades/dbpatches/1.0alpha12_to_1.0beta1/mysql/patch.sql26
-rw-r--r--upgrades/dbpatches/1.0alpha12_to_1.0beta1/postgresql/patch.sql30
3 files changed, 85 insertions, 0 deletions
diff --git a/create/postgresql/schema.sql b/create/postgresql/schema.sql
index 606dafd2..a07d931b 100644
--- a/create/postgresql/schema.sql
+++ b/create/postgresql/schema.sql
@@ -77,6 +77,7 @@ CREATE TABLE triggers (
triggerid serial,
expression varchar(255) DEFAULT '' NOT NULL,
description varchar(255) DEFAULT '' NOT NULL,
+ url varchar(255) DEFAULT '' NOT NULL,
istrue int4 DEFAULT '0' NOT NULL,
priority int2 DEFAULT '0' NOT NULL,
lastchange int4 DEFAULT '0' NOT NULL,
@@ -318,4 +319,32 @@ CREATE TABLE graphs_items (
FOREIGN KEY (itemid) REFERENCES items
);
+--
+-- Table structure for table 'services'
+--
+
+CREATE TABLE services (
+ serviceid serial,
+ name varchar(128) DEFAULT '' NOT NULL,
+ status int2 DEFAULT '0' NOT NULL,
+ triggerid int4,
+ PRIMARY KEY (serviceid)
+);
+
+CREATE INDEX services_triggerid on services (triggerid);
+
+--
+-- Table structure for table 'services_links'
+--
+
+CREATE TABLE services_links (
+ serviceupid int4 DEFAULT '0' NOT NULL,
+ servicedownid int4 DEFAULT '0' NOT NULL,
+ soft int2 DEFAULT '0' NOT NULL
+);
+
+CREATE INDEX services_links_serviceupid on services_links (serviceupid);
+CREATE INDEX services_links_servicedownid on services_links (servicedownid);
+CREATE UNIQUE INDEX services_links_upidownid on services_links (serviceupid, servicedownid);
+
VACUUM ANALYZE;
diff --git a/upgrades/dbpatches/1.0alpha12_to_1.0beta1/mysql/patch.sql b/upgrades/dbpatches/1.0alpha12_to_1.0beta1/mysql/patch.sql
index f9084a0d..dc69d2bc 100644
--- a/upgrades/dbpatches/1.0alpha12_to_1.0beta1/mysql/patch.sql
+++ b/upgrades/dbpatches/1.0alpha12_to_1.0beta1/mysql/patch.sql
@@ -1,3 +1,29 @@
alter table hosts add disable_until int(4) default '0' not null;
alter table triggers add url varchar(255) default '' not null;
+
+#
+# Table structure for table 'services'
+#
+
+CREATE TABLE services (
+ serviceid int(4) NOT NULL auto_increment,
+ name varchar(128) DEFAULT '' NOT NULL,
+ status int(1) DEFAULT '0' NOT NULL,
+ triggerid int(4),
+ PRIMARY KEY (serviceid),
+ KEY (triggerid)
+);
+
+#
+# Table structure for table 'services_links'
+#
+
+CREATE TABLE services_links (
+ serviceupid int(4) DEFAULT '0' NOT NULL,
+ servicedownid int(4) DEFAULT '0' NOT NULL,
+ soft int(1) DEFAULT '0' NOT NULL,
+ KEY (serviceupid),
+ KEY (servicedownid),
+ UNIQUE (serviceupid,servicedownid)
+);
diff --git a/upgrades/dbpatches/1.0alpha12_to_1.0beta1/postgresql/patch.sql b/upgrades/dbpatches/1.0alpha12_to_1.0beta1/postgresql/patch.sql
index dae13e7d..81df8d52 100644
--- a/upgrades/dbpatches/1.0alpha12_to_1.0beta1/postgresql/patch.sql
+++ b/upgrades/dbpatches/1.0alpha12_to_1.0beta1/postgresql/patch.sql
@@ -1 +1,31 @@
alter table hosts add disable_until int4 default '0' not null;
+
+alter table triggers add url varchar(255) default '' not null;
+
+--
+-- Table structure for table 'services'
+--
+
+CREATE TABLE services (
+ serviceid serial,
+ name varchar(128) DEFAULT '' NOT NULL,
+ status int2 DEFAULT '0' NOT NULL,
+ triggerid int4,
+ PRIMARY KEY (serviceid)
+);
+
+CREATE INDEX services_triggerid on services (triggerid);
+
+--
+-- Table structure for table 'services_links'
+--
+
+CREATE TABLE services_links (
+ serviceupid int4 DEFAULT '0' NOT NULL,
+ servicedownid int4 DEFAULT '0' NOT NULL,
+ soft int2 DEFAULT '0' NOT NULL
+);
+
+CREATE INDEX services_links_serviceupid on services_links (serviceupid);
+CREATE INDEX services_links_servicedownid on services_links (servicedownid);
+CREATE UNIQUE INDEX services_links_upidownid on services_links (serviceupid, servicedownid);