summaryrefslogtreecommitdiffstats
path: root/upgrades
diff options
context:
space:
mode:
authoralex <alex@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-02-28 19:16:46 +0000
committeralex <alex@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-02-28 19:16:46 +0000
commit7d79fcd9d326e2580cb3148a71f1cdfad565c93f (patch)
tree700c570ee1b6b93be6379a4613cce9dce8c51bea /upgrades
parentf5cf1fe9d024f7c13d0fee840abe4893500ea181 (diff)
downloadzabbix-7d79fcd9d326e2580cb3148a71f1cdfad565c93f.tar.gz
zabbix-7d79fcd9d326e2580cb3148a71f1cdfad565c93f.tar.xz
zabbix-7d79fcd9d326e2580cb3148a71f1cdfad565c93f.zip
Better PostgreSQL patches.
git-svn-id: svn://svn.zabbix.com/trunk@3856 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'upgrades')
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/acknowledges.sql8
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/actions.sql20
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/alerts.sql30
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/applications.sql10
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/auditlog.sql14
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/autoreg.sql10
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/conditions.sql14
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/config.sql14
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/events.sql12
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/functions.sql16
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/graphs.sql20
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/graphs_items.sql20
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/groups.sql6
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/help_items.sql8
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/history.sql10
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/history_log.sql16
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/history_str.sql6
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/history_str_sync.sql6
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/history_sync.sql8
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/history_text.sql8
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/history_uint.sql8
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/history_uint_sync.sql8
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/hosts.sql12
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/hosts_groups.sql18
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/hosts_profiles.sql22
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/hosts_templates.sql20
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/housekeeper.sql8
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/httpstep.sql10
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/httpstepitem.sql8
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/httptest.sql18
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/httptestitem.sql8
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/ids.sql8
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/images.sql10
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/items.sql42
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/items_applications.sql20
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/mappings.sql10
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/media.sql12
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/media_type.sql22
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/node_cksum.sql14
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/node_configlog.sql16
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/nodes.sql16
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/profiles.sql20
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/rights.sql14
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/screens.sql6
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/screens_items.sql28
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/service_alarms.sql8
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/services.sql14
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/services_links.sql10
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/services_times.sql6
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/sessions.sql10
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/sysmaps.sql12
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/sysmaps_elements.sql18
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/sysmaps_links.sql22
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/trends.sql12
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/trigger_depends.sql20
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/triggers.sql20
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/users.sql8
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/users_groups.sql20
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/usrgrp.sql6
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/valuemaps.sql6
60 files changed, 413 insertions, 413 deletions
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/acknowledges.sql b/upgrades/dbpatches/1.3/postgresql/patch/acknowledges.sql
index 15336116..7846291f 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/acknowledges.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/acknowledges.sql
@@ -1,7 +1,7 @@
CREATE TABLE acknowledges_tmp (
- acknowledgeid bigint DEFAULT '0' NOT NULL,
- userid bigint unsigned DEFAULT '0' NOT NULL,
- eventid bigint unsigned DEFAULT '0' NOT NULL,
+ acknowledgeid bigint DEFAULT '0' NOT NULL,
+ userid bigint DEFAULT '0' NOT NULL,
+ eventid bigint DEFAULT '0' NOT NULL,
clock integer DEFAULT '0' NOT NULL,
message varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (acknowledgeid)
@@ -12,4 +12,4 @@ CREATE INDEX acknowledges_3 on acknowledges_tmp (clock);
insert into acknowledges_tmp select * from acknowledges;
drop table acknowledges;
-alter table acknowledges_tmp rename acknowledges;
+alter table acknowledges_tmp rename to acknowledges;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/actions.sql b/upgrades/dbpatches/1.3/postgresql/patch/actions.sql
index 7581dd2c..36042556 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/actions.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/actions.sql
@@ -1,18 +1,18 @@
CREATE TABLE actions_tmp (
- actionid bigint unsigned DEFAULT '0' NOT NULL,
- userid bigint unsigned DEFAULT '0' NOT NULL,
+ actionid bigint DEFAULT '0' NOT NULL,
+ userid bigint DEFAULT '0' NOT NULL,
subject varchar(255) DEFAULT '' NOT NULL,
- message blob DEFAULT '' NOT NULL,
- recipient integer DEFAULT '0' NOT NULL,
- maxrepeats integer DEFAULT '0' NOT NULL,
- repeatdelay integer DEFAULT '600' NOT NULL,
+ message text DEFAULT '' NOT NULL,
+ recipient integer DEFAULT '0' NOT NULL,
+ maxrepeats integer DEFAULT '0' NOT NULL,
+ repeatdelay integer DEFAULT '600' NOT NULL,
source integer DEFAULT '0' NOT NULL,
- actiontype integer DEFAULT '0' NOT NULL,
+ actiontype integer DEFAULT '0' NOT NULL,
status integer DEFAULT '0' NOT NULL,
- scripts blob DEFAULT '' NOT NULL,
+ scripts text DEFAULT '' NOT NULL,
PRIMARY KEY (actionid)
-) ENGINE=InnoDB ;
+);
insert into actions_tmp select * from actions;
drop table actions;
-alter table actions_tmp rename actions;
+alter table actions_tmp rename to actions;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/alerts.sql b/upgrades/dbpatches/1.3/postgresql/patch/alerts.sql
index 19230ecb..70cfd8ae 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/alerts.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/alerts.sql
@@ -1,22 +1,22 @@
CREATE TABLE alerts_tmp (
- alertid bigint unsigned DEFAULT '0' NOT NULL,
- actionid bigint unsigned DEFAULT '0' NOT NULL,
- triggerid bigint unsigned DEFAULT '0' NOT NULL,
- userid bigint unsigned DEFAULT '0' NOT NULL,
- clock integer DEFAULT '0' NOT NULL,
- mediatypeid bigint unsigned DEFAULT '0' NOT NULL,
+ alertid bigint DEFAULT '0' NOT NULL,
+ actionid bigint DEFAULT '0' NOT NULL,
+ triggerid bigint DEFAULT '0' NOT NULL,
+ userid bigint DEFAULT '0' NOT NULL,
+ clock integer DEFAULT '0' NOT NULL,
+ mediatypeid bigint DEFAULT '0' NOT NULL,
sendto varchar(100) DEFAULT '' NOT NULL,
subject varchar(255) DEFAULT '' NOT NULL,
- message blob DEFAULT '' NOT NULL,
- status integer DEFAULT '0' NOT NULL,
- retries integer DEFAULT '0' NOT NULL,
+ message text DEFAULT '' NOT NULL,
+ status integer DEFAULT '0' NOT NULL,
+ retries integer DEFAULT '0' NOT NULL,
error varchar(128) DEFAULT '' NOT NULL,
- repeats integer DEFAULT '0' NOT NULL,
- maxrepeats integer DEFAULT '0' NOT NULL,
- nextcheck integer DEFAULT '0' NOT NULL,
- delay integer DEFAULT '0' NOT NULL,
+ repeats integer DEFAULT '0' NOT NULL,
+ maxrepeats integer DEFAULT '0' NOT NULL,
+ nextcheck integer DEFAULT '0' NOT NULL,
+ delay integer DEFAULT '0' NOT NULL,
PRIMARY KEY (alertid)
-) ENGINE=InnoDB ;
+);
CREATE INDEX alerts_1 on alerts_tmp (actionid);
CREATE INDEX alerts_2 on alerts_tmp (clock);
CREATE INDEX alerts_3 on alerts_tmp (triggerid);
@@ -26,4 +26,4 @@ CREATE INDEX alerts_6 on alerts_tmp (userid);
insert into alerts_tmp select * from alerts;
drop table alerts;
-alter table alerts_tmp rename alerts;
+alter table alerts_tmp rename to alerts;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/applications.sql b/upgrades/dbpatches/1.3/postgresql/patch/applications.sql
index 97ff0845..13d05bd3 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/applications.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/applications.sql
@@ -1,14 +1,14 @@
CREATE TABLE applications_tmp (
- applicationid bigint unsigned DEFAULT '0' NOT NULL,
- hostid bigint unsigned DEFAULT '0' NOT NULL,
+ applicationid bigint DEFAULT '0' NOT NULL,
+ hostid bigint DEFAULT '0' NOT NULL,
name varchar(255) DEFAULT '' NOT NULL,
- templateid bigint unsigned DEFAULT '0' NOT NULL,
+ templateid bigint DEFAULT '0' NOT NULL,
PRIMARY KEY (applicationid)
-) ENGINE=InnoDB;
+);
CREATE INDEX applications_1 on applications_tmp (templateid);
CREATE UNIQUE INDEX applications_2 on applications_tmp (hostid,name);
insert into applications_tmp select * from applications;
drop table applications;
-alter table applications_tmp rename applications;
+alter table applications_tmp rename to applications;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/auditlog.sql b/upgrades/dbpatches/1.3/postgresql/patch/auditlog.sql
index 6db8afbf..a262a3a8 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/auditlog.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/auditlog.sql
@@ -1,15 +1,15 @@
CREATE TABLE auditlog_tmp (
- auditid bigint unsigned DEFAULT '0' NOT NULL,
- userid bigint unsigned DEFAULT '0' NOT NULL,
- clock integer DEFAULT '0' NOT NULL,
- action integer DEFAULT '0' NOT NULL,
- resourcetype integer DEFAULT '0' NOT NULL,
+ auditid bigint DEFAULT '0' NOT NULL,
+ userid bigint DEFAULT '0' NOT NULL,
+ clock integer DEFAULT '0' NOT NULL,
+ action integer DEFAULT '0' NOT NULL,
+ resourcetype integer DEFAULT '0' NOT NULL,
details varchar(128) DEFAULT '0' NOT NULL,
PRIMARY KEY (auditid)
-) ENGINE=InnoDB;
+);
CREATE INDEX auditlog_1 on auditlog_tmp (userid,clock);
CREATE INDEX auditlog_2 on auditlog_tmp (clock);
insert into auditlog_tmp select * from auditlog;
drop table auditlog;
-alter table auditlog_tmp rename auditlog;
+alter table auditlog_tmp rename to auditlog;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/autoreg.sql b/upgrades/dbpatches/1.3/postgresql/patch/autoreg.sql
index 9a9861d2..5ef888dd 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/autoreg.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/autoreg.sql
@@ -1,11 +1,11 @@
CREATE TABLE autoreg_tmp (
- id bigint unsigned DEFAULT '0' NOT NULL,
- priority integer DEFAULT '0' NOT NULL,
+ id bigint DEFAULT '0' NOT NULL,
+ priority integer DEFAULT '0' NOT NULL,
pattern varchar(255) DEFAULT '' NOT NULL,
- hostid bigint unsigned DEFAULT '0' NOT NULL,
+ hostid bigint DEFAULT '0' NOT NULL,
PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
insert into autoreg_tmp select * from autoreg;
drop table autoreg;
-alter table autoreg_tmp rename autoreg;
+alter table autoreg_tmp rename to autoreg;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/conditions.sql b/upgrades/dbpatches/1.3/postgresql/patch/conditions.sql
index ddf10df4..e0f8f834 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/conditions.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/conditions.sql
@@ -1,13 +1,13 @@
CREATE TABLE conditions_tmp (
- conditionid bigint unsigned DEFAULT '0' NOT NULL,
- actionid bigint unsigned DEFAULT '0' NOT NULL,
- conditiontype integer DEFAULT '0' NOT NULL,
- operator integer DEFAULT '0' NOT NULL,
- value varchar(255) DEFAULT '' NOT NULL,
+ conditionid bigint DEFAULT '0' NOT NULL,
+ actionid bigint DEFAULT '0' NOT NULL,
+ conditiontype integer DEFAULT '0' NOT NULL,
+ operator integer DEFAULT '0' NOT NULL,
+ value varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (conditionid)
-) ENGINE=InnoDB;
+);
CREATE INDEX conditions_1 on conditions_tmp (actionid);
insert into conditions_tmp select * from conditions;
drop table conditions;
-alter table conditions_tmp rename conditions;
+alter table conditions_tmp rename to conditions;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/config.sql b/upgrades/dbpatches/1.3/postgresql/patch/config.sql
index 6f88f069..b7f9e2a6 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/config.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/config.sql
@@ -1,13 +1,13 @@
CREATE TABLE config_tmp (
- configid bigint unsigned DEFAULT '0' NOT NULL,
- alert_history integer DEFAULT '0' NOT NULL,
- event_history integer DEFAULT '0' NOT NULL,
- refresh_unsupported integer DEFAULT '0' NOT NULL,
+ configid bigint DEFAULT '0' NOT NULL,
+ alert_history integer DEFAULT '0' NOT NULL,
+ event_history integer DEFAULT '0' NOT NULL,
+ refresh_unsupported integer DEFAULT '0' NOT NULL,
work_period varchar(100) DEFAULT '1-5,00:00-24:00' NOT NULL,
- alert_usrgrpid bigint unsigned DEFAULT '0' NOT NULL,
+ alert_usrgrpid bigint DEFAULT '0' NOT NULL,
PRIMARY KEY (configid)
-) ENGINE=InnoDB;
+);
insert into config_tmp select 1,alert_history,alarm_history,refresh_unsupported,work_period,0 from config;
drop table config;
-alter table config_tmp rename config;
+alter table config_tmp rename to config;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/events.sql b/upgrades/dbpatches/1.3/postgresql/patch/events.sql
index 518f1c54..f7e6f4f5 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/events.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/events.sql
@@ -1,11 +1,11 @@
CREATE TABLE events (
- eventid bigint unsigned DEFAULT '0' NOT NULL,
- triggerid bigint unsigned DEFAULT '0' NOT NULL,
- clock integer DEFAULT '0' NOT NULL,
- value integer DEFAULT '0' NOT NULL,
- acknowledged integer DEFAULT '0' NOT NULL,
+ eventid bigint DEFAULT '0' NOT NULL,
+ triggerid bigint DEFAULT '0' NOT NULL,
+ clock integer DEFAULT '0' NOT NULL,
+ value integer DEFAULT '0' NOT NULL,
+ acknowledged integer DEFAULT '0' NOT NULL,
PRIMARY KEY (eventid)
-) ENGINE=InnoDB;
+);
CREATE INDEX events_1 on events (triggerid,clock);
CREATE INDEX events_2 on events (clock);
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/functions.sql b/upgrades/dbpatches/1.3/postgresql/patch/functions.sql
index 721b8ce0..ca5bd668 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/functions.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/functions.sql
@@ -1,15 +1,15 @@
CREATE TABLE functions_tmp (
- functionid bigint unsigned DEFAULT '0' NOT NULL,
- itemid bigint unsigned DEFAULT '0' NOT NULL,
- triggerid bigint unsigned DEFAULT '0' NOT NULL,
- lastvalue varchar(255) ,
- function varchar(12) DEFAULT '' NOT NULL,
- parameter varchar(255) DEFAULT '0' NOT NULL,
+ functionid bigint DEFAULT '0' NOT NULL,
+ itemid bigint DEFAULT '0' NOT NULL,
+ triggerid bigint DEFAULT '0' NOT NULL,
+ lastvalue varchar(255) ,
+ function varchar(12) DEFAULT '' NOT NULL,
+ parameter varchar(255) DEFAULT '0' NOT NULL,
PRIMARY KEY (functionid)
-) ENGINE=InnoDB;
+);
CREATE INDEX functions_1 on functions_tmp (triggerid);
CREATE INDEX functions_2 on functions_tmp (itemid,function,parameter);
insert into functions_tmp select * from functions;
drop table functions;
-alter table functions_tmp rename functions;
+alter table functions_tmp rename to functions;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/graphs.sql b/upgrades/dbpatches/1.3/postgresql/patch/graphs.sql
index 03bb2fb0..38a6c1a4 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/graphs.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/graphs.sql
@@ -1,19 +1,19 @@
CREATE TABLE graphs_tmp (
- graphid bigint unsigned DEFAULT '0' NOT NULL,
+ graphid bigint DEFAULT '0' NOT NULL,
name varchar(128) DEFAULT '' NOT NULL,
- width integer DEFAULT '0' NOT NULL,
- height integer DEFAULT '0' NOT NULL,
- yaxistype integer DEFAULT '0' NOT NULL,
- yaxismin double(16,4) DEFAULT '0' NOT NULL,
- yaxismax double(16,4) DEFAULT '0' NOT NULL,
- templateid bigint unsigned DEFAULT '0' NOT NULL,
- show_work_period integer DEFAULT '1' NOT NULL,
+ width integer DEFAULT '0' NOT NULL,
+ height integer DEFAULT '0' NOT NULL,
+ yaxistype integer DEFAULT '0' NOT NULL,
+ yaxismin numeric(16,4) DEFAULT '0' NOT NULL,
+ yaxismax numeric(16,4) DEFAULT '0' NOT NULL,
+ templateid bigint DEFAULT '0' NOT NULL,
+ show_work_period integer DEFAULT '1' NOT NULL,
show_triggers integer DEFAULT '1' NOT NULL,
graphtype integer DEFAULT '0' NOT NULL,
PRIMARY KEY (graphid)
-) ENGINE=InnoDB;
+);
CREATE INDEX graphs_graphs_1 on graphs_tmp (name);
insert into graphs_tmp select *,0 from graphs;
drop table graphs;
-alter table graphs_tmp rename graphs;
+alter table graphs_tmp rename to graphs;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/graphs_items.sql b/upgrades/dbpatches/1.3/postgresql/patch/graphs_items.sql
index e5184b6b..5236f0a4 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/graphs_items.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/graphs_items.sql
@@ -1,17 +1,17 @@
CREATE TABLE graphs_items_tmp (
- gitemid bigint unsigned DEFAULT '0' NOT NULL,
- graphid bigint unsigned DEFAULT '0' NOT NULL,
- itemid bigint unsigned DEFAULT '0' NOT NULL,
- drawtype integer DEFAULT '0' NOT NULL,
- sortorder integer DEFAULT '0' NOT NULL,
+ gitemid bigint DEFAULT '0' NOT NULL,
+ graphid bigint DEFAULT '0' NOT NULL,
+ itemid bigint DEFAULT '0' NOT NULL,
+ drawtype integer DEFAULT '0' NOT NULL,
+ sortorder integer DEFAULT '0' NOT NULL,
color varchar(32) DEFAULT 'Dark Green' NOT NULL,
- yaxisside integer DEFAULT '1' NOT NULL,
- calc_fnc integer DEFAULT '2' NOT NULL,
+ yaxisside integer DEFAULT '1' NOT NULL,
+ calc_fnc integer DEFAULT '2' NOT NULL,
type integer DEFAULT '0' NOT NULL,
- periods_cnt integer DEFAULT '5' NOT NULL,
+ periods_cnt integer DEFAULT '5' NOT NULL,
PRIMARY KEY (gitemid)
-) ENGINE=InnoDB;
+);
insert into graphs_items_tmp select * from graphs_items;
drop table graphs_items;
-alter table graphs_items_tmp rename graphs_items;
+alter table graphs_items_tmp rename to graphs_items;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/groups.sql b/upgrades/dbpatches/1.3/postgresql/patch/groups.sql
index 87ad39b2..8a94be71 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/groups.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/groups.sql
@@ -1,10 +1,10 @@
CREATE TABLE groups_tmp (
- groupid bigint unsigned DEFAULT '0' NOT NULL,
+ groupid bigint DEFAULT '0' NOT NULL,
name varchar(64) DEFAULT '' NOT NULL,
PRIMARY KEY (groupid)
-) ENGINE=InnoDB;
+);
CREATE INDEX groups_1 on groups_tmp (name);
insert into groups_tmp select * from groups;
drop table groups;
-alter table groups_tmp rename groups;
+alter table groups_tmp rename to groups;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/help_items.sql b/upgrades/dbpatches/1.3/postgresql/patch/help_items.sql
index ca347713..4cfdf525 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/help_items.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/help_items.sql
@@ -1,10 +1,10 @@
CREATE TABLE help_items_tmp (
- itemtype integer DEFAULT '0' NOT NULL,
+ itemtype integer DEFAULT '0' NOT NULL,
key_ varchar(255) DEFAULT '' NOT NULL,
- description varchar(255) DEFAULT '' NOT NULL,
+ description varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (itemtype,key_)
-) ENGINE=InnoDB;
+);
insert into help_items_tmp select * from help_items;
drop table help_items;
-alter table help_items_tmp rename help_items;
+alter table help_items_tmp rename to help_items;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/history.sql b/upgrades/dbpatches/1.3/postgresql/patch/history.sql
index c08bae1c..aa7a9664 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/history.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/history.sql
@@ -1,10 +1,10 @@
CREATE TABLE history_tmp (
- itemid bigint unsigned DEFAULT '0' NOT NULL,
- clock integer DEFAULT '0' NOT NULL,
- value double(16,4) DEFAULT '0.0000' NOT NULL
-) ENGINE=InnoDB;
+ itemid bigint DEFAULT '0' NOT NULL,
+ clock integer DEFAULT '0' NOT NULL,
+ value numeric(16,4) DEFAULT '0.0000' NOT NULL
+);
CREATE INDEX history_1 on history_tmp (itemid,clock);
insert into history_tmp select * from history;
drop table history;
-alter table history_tmp rename history;
+alter table history_tmp rename to history;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/history_log.sql b/upgrades/dbpatches/1.3/postgresql/patch/history_log.sql
index 683d0aa9..b00151ee 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/history_log.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/history_log.sql
@@ -1,15 +1,15 @@
CREATE TABLE history_log_tmp (
- id bigint unsigned DEFAULT '0' NOT NULL,
- itemid bigint unsigned DEFAULT '0' NOT NULL,
+ id bigint DEFAULT '0' NOT NULL,
+ itemid bigint DEFAULT '0' NOT NULL,
clock integer DEFAULT '0' NOT NULL,
- timestamp integer DEFAULT '0' NOT NULL,
- source varchar(64) DEFAULT '' NOT NULL,
- severity integer DEFAULT '0' NOT NULL,
- value text DEFAULT '' NOT NULL,
+ timestamp integer DEFAULT '0' NOT NULL,
+ source varchar(64) DEFAULT '' NOT NULL,
+ severity integer DEFAULT '0' NOT NULL,
+ value varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
CREATE INDEX history_log_1 on history_log_tmp (itemid,clock);
insert into history_log_tmp select * from history_log;
drop table history_log;
-alter table history_log_tmp rename history_log;
+alter table history_log_tmp rename to history_log;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/history_str.sql b/upgrades/dbpatches/1.3/postgresql/patch/history_str.sql
index add46772..3f083b74 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/history_str.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/history_str.sql
@@ -1,10 +1,10 @@
CREATE TABLE history_str_tmp (
- itemid bigint unsigned DEFAULT '0' NOT NULL,
+ itemid bigint DEFAULT '0' NOT NULL,
clock integer DEFAULT '0' NOT NULL,
value varchar(255) DEFAULT '' NOT NULL
-) ENGINE=InnoDB;
+);
CREATE INDEX history_str_1 on history_str_tmp (itemid,clock);
insert into history_str_tmp select * from history_str;
drop table history_str;
-alter table history_str_tmp rename history_str;
+alter table history_str_tmp rename to history_str;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/history_str_sync.sql b/upgrades/dbpatches/1.3/postgresql/patch/history_str_sync.sql
index 22e1b4f2..091603fc 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/history_str_sync.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/history_str_sync.sql
@@ -1,9 +1,9 @@
CREATE TABLE history_str_sync (
id serial ,
- nodeid bigint unsigned DEFAULT '0' NOT NULL,
- itemid bigint unsigned DEFAULT '0' NOT NULL,
+ nodeid bigint DEFAULT '0' NOT NULL,
+ itemid bigint DEFAULT '0' NOT NULL,
clock integer DEFAULT '0' NOT NULL,
value varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
CREATE INDEX history_str_sync_1 on history_str_sync (nodeid,id);
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/history_sync.sql b/upgrades/dbpatches/1.3/postgresql/patch/history_sync.sql
index 17fd64f4..237cbcba 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/history_sync.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/history_sync.sql
@@ -1,9 +1,9 @@
CREATE TABLE history_sync (
id serial ,
- nodeid bigint unsigned DEFAULT '0' NOT NULL,
- itemid bigint unsigned DEFAULT '0' NOT NULL,
+ nodeid bigint DEFAULT '0' NOT NULL,
+ itemid bigint DEFAULT '0' NOT NULL,
clock integer DEFAULT '0' NOT NULL,
- value double(16,4) DEFAULT '0.0000' NOT NULL,
+ value numeric(16,4) DEFAULT '0.0000' NOT NULL,
PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
CREATE INDEX history_sync_1 on history_sync (nodeid,id);
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/history_text.sql b/upgrades/dbpatches/1.3/postgresql/patch/history_text.sql
index f67efcae..501e5090 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/history_text.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/history_text.sql
@@ -1,12 +1,12 @@
CREATE TABLE history_text_tmp (
- id bigint unsigned DEFAULT '0' NOT NULL,
- itemid bigint unsigned DEFAULT '0' NOT NULL,
+ id bigint DEFAULT '0' NOT NULL,
+ itemid bigint DEFAULT '0' NOT NULL,
clock integer DEFAULT '0' NOT NULL,
value text DEFAULT '' NOT NULL,
PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
CREATE INDEX history_text_1 on history_text_tmp (itemid,clock);
insert into history_text_tmp select * from history_text;
drop table history_text;
-alter table history_text_tmp rename history_text;
+alter table history_text_tmp rename to history_text;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/history_uint.sql b/upgrades/dbpatches/1.3/postgresql/patch/history_uint.sql
index 1b451a73..942d4d37 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/history_uint.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/history_uint.sql
@@ -1,10 +1,10 @@
CREATE TABLE history_uint_tmp (
- itemid bigint unsigned DEFAULT '0' NOT NULL,
+ itemid bigint DEFAULT '0' NOT NULL,
clock integer DEFAULT '0' NOT NULL,
- value bigint unsigned DEFAULT '0' NOT NULL
-) ENGINE=InnoDB;
+ value bigint DEFAULT '0' NOT NULL
+);
CREATE INDEX history_uint_1 on history_uint_tmp (itemid,clock);
insert into history_uint_tmp select * from history_uint;
drop table history_uint;
-alter table history_uint_tmp rename history_uint;
+alter table history_uint_tmp rename to history_uint;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/history_uint_sync.sql b/upgrades/dbpatches/1.3/postgresql/patch/history_uint_sync.sql
index 3f875b42..369d386a 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/history_uint_sync.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/history_uint_sync.sql
@@ -1,9 +1,9 @@
CREATE TABLE history_uint_sync (
id serial ,
- nodeid bigint unsigned DEFAULT '0' NOT NULL,
- itemid bigint unsigned DEFAULT '0' NOT NULL,
+ nodeid bigint DEFAULT '0' NOT NULL,
+ itemid bigint DEFAULT '0' NOT NULL,
clock integer DEFAULT '0' NOT NULL,
- value bigint unsigned DEFAULT '0' NOT NULL,
+ value bigint DEFAULT '0' NOT NULL,
PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
CREATE INDEX history_uint_sync_1 on history_uint_sync (nodeid,id);
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/hosts.sql b/upgrades/dbpatches/1.3/postgresql/patch/hosts.sql
index 82bc0b33..8b633a94 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/hosts.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/hosts.sql
@@ -1,20 +1,20 @@
CREATE TABLE hosts_tmp (
- hostid bigint unsigned DEFAULT '0' NOT NULL,
+ hostid bigint DEFAULT '0' NOT NULL,
host varchar(64) DEFAULT '' NOT NULL,
dns varchar(64) DEFAULT '' NOT NULL,
useip integer DEFAULT '1' NOT NULL,
ip varchar(15) DEFAULT '127.0.0.1' NOT NULL,
port integer DEFAULT '0' NOT NULL,
status integer DEFAULT '0' NOT NULL,
- disable_until integer DEFAULT '0' NOT NULL,
+ disable_until integer DEFAULT '0' NOT NULL,
error varchar(128) DEFAULT '' NOT NULL,
- available integer DEFAULT '0' NOT NULL,
- errors_from integer DEFAULT '0' NOT NULL,
+ available integer DEFAULT '0' NOT NULL,
+ errors_from integer DEFAULT '0' NOT NULL,
PRIMARY KEY (hostid)
-) ENGINE=InnoDB;
+);
CREATE INDEX hosts_1 on hosts_tmp (host);
CREATE INDEX hosts_2 on hosts_tmp (status);
insert into hosts_tmp select hostid,host,host,useip,ip,port,status,disable_until,error,available,errors_from from hosts;
drop table hosts;
-alter table hosts_tmp rename hosts;
+alter table hosts_tmp rename to hosts;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/hosts_groups.sql b/upgrades/dbpatches/1.3/postgresql/patch/hosts_groups.sql
index 457d6ffb..d8bfe0bf 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/hosts_groups.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/hosts_groups.sql
@@ -1,9 +1,9 @@
CREATE TABLE hosts_groups_tmp (
- hostgroupid bigint unsigned NOT NULL auto_increment,
- hostid bigint unsigned DEFAULT '0' NOT NULL,
- groupid bigint unsigned DEFAULT '0' NOT NULL,
+ hostgroupid bigint DEFAULT '0' NOT NULL,
+ hostid bigint DEFAULT '0' NOT NULL,
+ groupid bigint DEFAULT '0' NOT NULL,
PRIMARY KEY (hostgroupid)
-) ENGINE=InnoDB;
+);
CREATE INDEX hosts_groups_groups_1 on hosts_groups_tmp (hostid,groupid);
insert into hosts_groups_tmp select NULL,hostid,groupid from hosts_groups;
@@ -12,13 +12,13 @@ alter table hosts_groups_tmp rename hosts_groups;
CREATE TABLE hosts_groups_tmp (
- hostgroupid bigint unsigned DEFAULT '0' NOT NULL,
- hostid bigint unsigned DEFAULT '0' NOT NULL,
- groupid bigint unsigned DEFAULT '0' NOT NULL,
+ hostgroupid bigint DEFAULT '0' NOT NULL,
+ hostid bigint DEFAULT '0' NOT NULL,
+ groupid bigint DEFAULT '0' NOT NULL,
PRIMARY KEY (hostgroupid)
-) ENGINE=InnoDB;
+);
CREATE INDEX hosts_groups_groups_1 on hosts_groups_tmp (hostid,groupid);
insert into hosts_groups_tmp select * from hosts_groups;
drop table hosts_groups;
-alter table hosts_groups_tmp rename hosts_groups;
+alter table hosts_groups_tmp rename to hosts_groups;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/hosts_profiles.sql b/upgrades/dbpatches/1.3/postgresql/patch/hosts_profiles.sql
index 8213add8..e6be1ab9 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/hosts_profiles.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/hosts_profiles.sql
@@ -1,19 +1,19 @@
CREATE TABLE hosts_profiles_tmp (
- hostid bigint unsigned DEFAULT '0' NOT NULL,
- devicetype varchar(64) DEFAULT '' NOT NULL,
+ hostid bigint DEFAULT '0' NOT NULL,
+ devicetype varchar(64) DEFAULT '' NOT NULL,
name varchar(64) DEFAULT '' NOT NULL,
os varchar(64) DEFAULT '' NOT NULL,
- serialno varchar(64) DEFAULT '' NOT NULL,
+ serialno varchar(64) DEFAULT '' NOT NULL,
tag varchar(64) DEFAULT '' NOT NULL,
- macaddress varchar(64) DEFAULT '' NOT NULL,
- hardware blob DEFAULT '' NOT NULL,
- software blob DEFAULT '' NOT NULL,
- contact blob DEFAULT '' NOT NULL,
- location blob DEFAULT '' NOT NULL,
- notes blob DEFAULT '' NOT NULL,
+ macaddress varchar(64) DEFAULT '' NOT NULL,
+ hardware text DEFAULT '' NOT NULL,
+ software text DEFAULT '' NOT NULL,
+ contact text DEFAULT '' NOT NULL,
+ location text DEFAULT '' NOT NULL,
+ notes text DEFAULT '' NOT NULL,
PRIMARY KEY (hostid)
-) ENGINE=InnoDB;
+);
insert into hosts_profiles_tmp select * from hosts_profiles;
drop table hosts_profiles;
-alter table hosts_profiles_tmp rename hosts_profiles;
+alter table hosts_profiles_tmp rename to hosts_profiles;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/hosts_templates.sql b/upgrades/dbpatches/1.3/postgresql/patch/hosts_templates.sql
index 98dc2df0..d42bcf5a 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/hosts_templates.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/hosts_templates.sql
@@ -1,23 +1,23 @@
CREATE TABLE hosts_templates_tmp (
- hosttemplateid bigint unsigned NOT NULL auto_increment,
- hostid bigint unsigned DEFAULT '0' NOT NULL,
- templateid bigint unsigned DEFAULT '0' NOT NULL,
+ hosttemplateid bigint DEFAULT '0' NOT NULL,
+ hostid bigint DEFAULT '0' NOT NULL,
+ templateid bigint DEFAULT '0' NOT NULL,
PRIMARY KEY (hosttemplateid)
-) ENGINE=InnoDB;
+);
CREATE UNIQUE INDEX hosts_templates_1 on hosts_templates_tmp (hostid,templateid);
insert into hosts_templates_tmp select NULL,hostid,templateid from hosts_templates;
drop table hosts_templates;
-alter table hosts_templates_tmp rename hosts_templates;
+alter table hosts_templates_tmp rename to hosts_templates;
CREATE TABLE hosts_templates_tmp (
- hosttemplateid bigint unsigned DEFAULT '0' NOT NULL,
- hostid bigint unsigned DEFAULT '0' NOT NULL,
- templateid bigint unsigned DEFAULT '0' NOT NULL,
+ hosttemplateid bigint DEFAULT '0' NOT NULL,
+ hostid bigint DEFAULT '0' NOT NULL,
+ templateid bigint DEFAULT '0' NOT NULL,
PRIMARY KEY (hosttemplateid)
-) ENGINE=InnoDB;
+);
CREATE UNIQUE INDEX hosts_templates_1 on hosts_templates_tmp (hostid,templateid);
insert into hosts_templates_tmp select * from hosts_templates;
drop table hosts_templates;
-alter table hosts_templates_tmp rename hosts_templates;
+alter table hosts_templates_tmp rename to hosts_templates;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/housekeeper.sql b/upgrades/dbpatches/1.3/postgresql/patch/housekeeper.sql
index 15c88634..a05cb024 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/housekeeper.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/housekeeper.sql
@@ -1,11 +1,11 @@
CREATE TABLE housekeeper_tmp (
- housekeeperid bigint unsigned DEFAULT '0' NOT NULL,
- tablename varchar(64) DEFAULT '' NOT NULL,
+ housekeeperid bigint DEFAULT '0' NOT NULL,
+ tablename varchar(64) DEFAULT '' NOT NULL,
field varchar(64) DEFAULT '' NOT NULL,
value integer DEFAULT '0' NOT NULL,
PRIMARY KEY (housekeeperid)
-) ENGINE=InnoDB;
+);
insert into housekeeper_tmp select * from housekeeper;
drop table housekeeper;
-alter table housekeeper_tmp rename housekeeper;
+alter table housekeeper_tmp rename to housekeeper;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/httpstep.sql b/upgrades/dbpatches/1.3/postgresql/patch/httpstep.sql
index b0cfd6ba..7f99fbfc 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/httpstep.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/httpstep.sql
@@ -1,12 +1,12 @@
CREATE TABLE httpstep (
- httpstepid bigint unsigned DEFAULT '0' NOT NULL,
- httptestid bigint unsigned DEFAULT '0' NOT NULL,
+ httpstepid bigint DEFAULT '0' NOT NULL,
+ httptestid bigint DEFAULT '0' NOT NULL,
name varchar(64) DEFAULT '' NOT NULL,
no integer DEFAULT '0' NOT NULL,
url varchar(128) DEFAULT '' NOT NULL,
timeout integer DEFAULT '30' NOT NULL,
- posts blob DEFAULT '' NOT NULL,
- required varchar(255) DEFAULT '' NOT NULL,
+ posts text DEFAULT '' NOT NULL,
+ required varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (httpstepid)
-) ENGINE=InnoDB;
+);
CREATE INDEX httpstep_httpstep_1 on httpstep (httptestid);
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/httpstepitem.sql b/upgrades/dbpatches/1.3/postgresql/patch/httpstepitem.sql
index 56b43ff4..c8232b97 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/httpstepitem.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/httpstepitem.sql
@@ -1,8 +1,8 @@
CREATE TABLE httpstepitem (
- httpstepitemid bigint unsigned DEFAULT '0' NOT NULL,
- httpstepid bigint unsigned DEFAULT '0' NOT NULL,
- itemid bigint unsigned DEFAULT '0' NOT NULL,
+ httpstepitemid bigint DEFAULT '0' NOT NULL,
+ httpstepid bigint DEFAULT '0' NOT NULL,
+ itemid bigint DEFAULT '0' NOT NULL,
type integer DEFAULT '0' NOT NULL,
PRIMARY KEY (httpstepitemid)
-) ENGINE=InnoDB;
+);
CREATE UNIQUE INDEX httpstepitem_httpstepitem_1 on httpstepitem (httpstepid,itemid);
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/httptest.sql b/upgrades/dbpatches/1.3/postgresql/patch/httptest.sql
index 9c0cacb5..ac1ed843 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/httptest.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/httptest.sql
@@ -1,18 +1,18 @@
CREATE TABLE httptest (
- httptestid bigint unsigned DEFAULT '0' NOT NULL,
+ httptestid bigint DEFAULT '0' NOT NULL,
name varchar(64) DEFAULT '' NOT NULL,
- applicationid bigint unsigned DEFAULT '0' NOT NULL,
- lastcheck integer DEFAULT '0' NOT NULL,
- nextcheck integer DEFAULT '0' NOT NULL,
- curstate integer DEFAULT '0' NOT NULL,
+ applicationid bigint DEFAULT '0' NOT NULL,
+ lastcheck integer DEFAULT '0' NOT NULL,
+ nextcheck integer DEFAULT '0' NOT NULL,
+ curstate integer DEFAULT '0' NOT NULL,
curstep integer DEFAULT '0' NOT NULL,
- lastfailedstep bigint unsigned DEFAULT '0' NOT NULL,
+ lastfailedstep bigint DEFAULT '0' NOT NULL,
delay integer DEFAULT '60' NOT NULL,
status integer DEFAULT '0' NOT NULL,
- macros blob DEFAULT '' NOT NULL,
+ macros text DEFAULT '' NOT NULL,
agent varchar(255) DEFAULT '' NOT NULL,
- time double(16,4) DEFAULT '0' NOT NULL,
+ time numeric(16,4) DEFAULT '0' NOT NULL,
error varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (httptestid)
-) ENGINE=InnoDB;
+);
CREATE INDEX httptest_httptest_1 on httptest (httptestid);
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/httptestitem.sql b/upgrades/dbpatches/1.3/postgresql/patch/httptestitem.sql
index 7efcc231..17ffd7c3 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/httptestitem.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/httptestitem.sql
@@ -1,8 +1,8 @@
CREATE TABLE httptestitem (
- httptestitemid bigint unsigned DEFAULT '0' NOT NULL,
- httptestid bigint unsigned DEFAULT '0' NOT NULL,
- itemid bigint unsigned DEFAULT '0' NOT NULL,
+ httptestitemid bigint DEFAULT '0' NOT NULL,
+ httptestid bigint DEFAULT '0' NOT NULL,
+ itemid bigint DEFAULT '0' NOT NULL,
type integer DEFAULT '0' NOT NULL,
PRIMARY KEY (httptestitemid)
-) ENGINE=InnoDB;
+);
CREATE UNIQUE INDEX httptestitem_httptestitem_1 on httptestitem (httptestid,itemid);
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/ids.sql b/upgrades/dbpatches/1.3/postgresql/patch/ids.sql
index 9080273f..8e49ef0e 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/ids.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/ids.sql
@@ -1,7 +1,7 @@
CREATE TABLE ids (
nodeid integer DEFAULT '0' NOT NULL,
- table_name varchar(64) DEFAULT '' NOT NULL,
- field_name varchar(64) DEFAULT '' NOT NULL,
- nextid bigint unsigned DEFAULT '0' NOT NULL,
+ table_name varchar(64) DEFAULT '' NOT NULL,
+ field_name varchar(64) DEFAULT '' NOT NULL,
+ nextid bigint DEFAULT '0' NOT NULL,
PRIMARY KEY (nodeid,table_name,field_name)
-) type=InnoDB;
+);
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/images.sql b/upgrades/dbpatches/1.3/postgresql/patch/images.sql
index d8867e1c..250068ae 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/images.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/images.sql
@@ -1,12 +1,12 @@
CREATE TABLE images_tmp (
- imageid bigint unsigned DEFAULT '0' NOT NULL,
- imagetype integer DEFAULT '0' NOT NULL,
+ imageid bigint DEFAULT '0' NOT NULL,
+ imagetype integer DEFAULT '0' NOT NULL,
name varchar(64) DEFAULT '0' NOT NULL,
- image longblob DEFAULT '' NOT NULL,
+ image bytea DEFAULT '' NOT NULL,
PRIMARY KEY (imageid)
-) ENGINE=InnoDB;
+);
CREATE INDEX images_1 on images_tmp (imagetype,name);
insert into images_tmp select * from images;
drop table images;
-alter table images_tmp rename images;
+alter table images_tmp rename to images;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/items.sql b/upgrades/dbpatches/1.3/postgresql/patch/items.sql
index 2093e4a2..f34aac7d 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/items.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/items.sql
@@ -1,43 +1,43 @@
CREATE TABLE items_tmp (
- itemid bigint unsigned DEFAULT '0' NOT NULL,
+ itemid bigint DEFAULT '0' NOT NULL,
type integer DEFAULT '0' NOT NULL,
- snmp_community varchar(64) DEFAULT '' NOT NULL,
- snmp_oid varchar(255) DEFAULT '' NOT NULL,
- snmp_port integer DEFAULT '161' NOT NULL,
- hostid bigint unsigned DEFAULT '0' NOT NULL,
- description varchar(255) DEFAULT '' NOT NULL,
+ snmp_community varchar(64) DEFAULT '' NOT NULL,
+ snmp_oid varchar(255) DEFAULT '' NOT NULL,
+ snmp_port integer DEFAULT '161' NOT NULL,
+ hostid bigint DEFAULT '0' NOT NULL,
+ description varchar(255) DEFAULT '' NOT NULL,
key_ varchar(255) DEFAULT '' NOT NULL,
delay integer DEFAULT '0' NOT NULL,
history integer DEFAULT '90' NOT NULL,
trends integer DEFAULT '365' NOT NULL,
- nextcheck integer DEFAULT '0' NOT NULL,
- lastvalue varchar(255) NULL,
- lastclock integer NULL,
- prevvalue varchar(255) NULL,
+ nextcheck integer DEFAULT '0' NOT NULL,
+ lastvalue varchar(255) NULL,
+ lastclock integer NULL,
+ prevvalue varchar(255) NULL,
status integer DEFAULT '0' NOT NULL,
- value_type integer DEFAULT '0' NOT NULL,
- trapper_hosts varchar(255) DEFAULT '' NOT NULL,
+ value_type integer DEFAULT '0' NOT NULL,
+ trapper_hosts varchar(255) DEFAULT '' NOT NULL,
units varchar(10) DEFAULT '' NOT NULL,
- multiplier integer DEFAULT '0' NOT NULL,
+ multiplier integer DEFAULT '0' NOT NULL,
delta integer DEFAULT '0' NOT NULL,
- prevorgvalue varchar(255) NULL,
+ prevorgvalue varchar(255) NULL,
snmpv3_securityname varchar(64) DEFAULT '' NOT NULL,
snmpv3_securitylevel integer DEFAULT '0' NOT NULL,
snmpv3_authpassphrase varchar(64) DEFAULT '' NOT NULL,
snmpv3_privpassphrase varchar(64) DEFAULT '' NOT NULL,
formula varchar(255) DEFAULT '0' NOT NULL,
error varchar(128) DEFAULT '' NOT NULL,
- lastlogsize integer DEFAULT '0' NOT NULL,
- logtimefmt varchar(64) DEFAULT '' NOT NULL,
- templateid bigint unsigned DEFAULT '0' NOT NULL,
- valuemapid bigint unsigned DEFAULT '0' NOT NULL,
- delay_flex varchar(255) DEFAULT '' NOT NULL,
+ lastlogsize integer DEFAULT '0' NOT NULL,
+ logtimefmt varchar(64) DEFAULT '' NOT NULL,
+ templateid bigint DEFAULT '0' NOT NULL,
+ valuemapid bigint DEFAULT '0' NOT NULL,
+ delay_flex varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (itemid)
-) ENGINE=InnoDB;
+);
CREATE UNIQUE INDEX items_1 on items_tmp (hostid,key_);
CREATE INDEX items_2 on items_tmp (nextcheck);
CREATE INDEX items_3 on items_tmp (status);
insert into items_tmp select *,'' from items;
drop table items;
-alter table items_tmp rename items;
+alter table items_tmp rename to items;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/items_applications.sql b/upgrades/dbpatches/1.3/postgresql/patch/items_applications.sql
index 92178eb7..9c345851 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/items_applications.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/items_applications.sql
@@ -1,23 +1,23 @@
CREATE TABLE items_applications_tmp (
- itemappid bigint unsigned NOT NULL auto_increment,
- applicationid bigint unsigned DEFAULT '0' NOT NULL,
- itemid bigint unsigned DEFAULT '0' NOT NULL,
+ itemappid bigint DEFAULT '0' NOT NULL,
+ applicationid bigint DEFAULT '0' NOT NULL,
+ itemid bigint DEFAULT '0' NOT NULL,
PRIMARY KEY (itemappid)
-) ENGINE=InnoDB;
+);
CREATE INDEX items_applications_1 on items_applications_tmp (applicationid,itemid);
insert into items_applications_tmp select NULL,applicationid,applicationid from items_applications;
drop table items_applications;
-alter table items_applications_tmp rename items_applications;
+alter table items_applications_tmp rename to items_applications;
CREATE TABLE items_applications_tmp (
- itemappid bigint unsigned DEFAULT '0' NOT NULL,
- applicationid bigint unsigned DEFAULT '0' NOT NULL,
- itemid bigint unsigned DEFAULT '0' NOT NULL,
+ itemappid bigint DEFAULT '0' NOT NULL,
+ applicationid bigint DEFAULT '0' NOT NULL,
+ itemid bigint DEFAULT '0' NOT NULL,
PRIMARY KEY (itemappid)
-) ENGINE=InnoDB;
+);
CREATE INDEX items_applications_1 on items_applications_tmp (applicationid,itemid);
insert into items_applications_tmp select * from items_applications;
drop table items_applications;
-alter table items_applications_tmp rename items_applications;
+alter table items_applications_tmp rename to items_applications;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/mappings.sql b/upgrades/dbpatches/1.3/postgresql/patch/mappings.sql
index afeb59ac..8c3d013d 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/mappings.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/mappings.sql
@@ -1,12 +1,12 @@
CREATE TABLE mappings_tmp (
- mappingid bigint unsigned DEFAULT '0' NOT NULL,
- valuemapid bigint unsigned DEFAULT '0' NOT NULL,
+ mappingid bigint DEFAULT '0' NOT NULL,
+ valuemapid bigint DEFAULT '0' NOT NULL,
value varchar(64) DEFAULT '' NOT NULL,
- newvalue varchar(64) DEFAULT '' NOT NULL,
+ newvalue varchar(64) DEFAULT '' NOT NULL,
PRIMARY KEY (mappingid)
-) ENGINE=InnoDB;
+);
CREATE INDEX mappings_1 on mappings_tmp (valuemapid);
insert into mappings_tmp select * from mappings;
drop table mappings;
-alter table mappings_tmp rename mappings;
+alter table mappings_tmp rename to mappings;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/media.sql b/upgrades/dbpatches/1.3/postgresql/patch/media.sql
index 00540275..b931ebe1 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/media.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/media.sql
@@ -1,16 +1,16 @@
CREATE TABLE media_tmp (
- mediaid bigint unsigned DEFAULT '0' NOT NULL,
- userid bigint unsigned DEFAULT '0' NOT NULL,
- mediatypeid bigint unsigned DEFAULT '0' NOT NULL,
+ mediaid bigint DEFAULT '0' NOT NULL,
+ userid bigint DEFAULT '0' NOT NULL,
+ mediatypeid bigint DEFAULT '0' NOT NULL,
sendto varchar(100) DEFAULT '' NOT NULL,
active integer DEFAULT '0' NOT NULL,
- severity integer DEFAULT '63' NOT NULL,
+ severity integer DEFAULT '63' NOT NULL,
period varchar(100) DEFAULT '1-7,00:00-23:59' NOT NULL,
PRIMARY KEY (mediaid)
-) ENGINE=InnoDB;
+);
CREATE INDEX media_1 on media_tmp (userid);
CREATE INDEX media_2 on media_tmp (mediatypeid);
insert into media_tmp select * from media;
drop table media;
-alter table media_tmp rename media;
+alter table media_tmp rename to media;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/media_type.sql b/upgrades/dbpatches/1.3/postgresql/patch/media_type.sql
index 09b55dec..898d2f3a 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/media_type.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/media_type.sql
@@ -1,17 +1,17 @@
CREATE TABLE media_type_tmp (
- mediatypeid bigint unsigned DEFAULT '0' NOT NULL,
+ mediatypeid bigint DEFAULT '0' NOT NULL,
type integer DEFAULT '0' NOT NULL,
- description varchar(100) DEFAULT '' NOT NULL,
- smtp_server varchar(255) DEFAULT '' NOT NULL,
- smtp_helo varchar(255) DEFAULT '' NOT NULL,
- smtp_email varchar(255) DEFAULT '' NOT NULL,
- exec_path varchar(255) DEFAULT '' NOT NULL,
- gsm_modem varchar(255) DEFAULT '' NOT NULL,
- username varchar(255) DEFAULT '' NOT NULL,
- passwd varchar(255) DEFAULT '' NOT NULL,
+ description varchar(100) DEFAULT '' NOT NULL,
+ smtp_server varchar(255) DEFAULT '' NOT NULL,
+ smtp_helo varchar(255) DEFAULT '' NOT NULL,
+ smtp_email varchar(255) DEFAULT '' NOT NULL,
+ exec_path varchar(255) DEFAULT '' NOT NULL,
+ gsm_modem varchar(255) DEFAULT '' NOT NULL,
+ username varchar(255) DEFAULT '' NOT NULL,
+ passwd varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (mediatypeid)
-) ENGINE=InnoDB;
+);
insert into media_type_tmp select mediatypeid,type,description,smtp_server,smtp_helo,smtp_email,exec_path,gsm_modem,'','' from media_type;
drop table media_type;
-alter table media_type_tmp rename media_type;
+alter table media_type_tmp rename to media_type;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/node_cksum.sql b/upgrades/dbpatches/1.3/postgresql/patch/node_cksum.sql
index 6e8752a7..f1edfb85 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/node_cksum.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/node_cksum.sql
@@ -1,11 +1,11 @@
CREATE TABLE node_cksum (
- cksumid bigint unsigned DEFAULT '0' NOT NULL,
- nodeid bigint unsigned DEFAULT '0' NOT NULL,
- tablename varchar(64) DEFAULT '' NOT NULL,
- fieldname varchar(64) DEFAULT '' NOT NULL,
- recordid bigint unsigned DEFAULT '0' NOT NULL,
- cksumtype integer DEFAULT '0' NOT NULL,
+ cksumid bigint DEFAULT '0' NOT NULL,
+ nodeid bigint DEFAULT '0' NOT NULL,
+ tablename varchar(64) DEFAULT '' NOT NULL,
+ fieldname varchar(64) DEFAULT '' NOT NULL,
+ recordid bigint DEFAULT '0' NOT NULL,
+ cksumtype integer DEFAULT '0' NOT NULL,
cksum char(32) DEFAULT '' NOT NULL,
PRIMARY KEY (cksumid)
-) ENGINE=InnoDB;
+);
CREATE INDEX node_cksum_cksum_1 on node_cksum (nodeid,tablename,fieldname,recordid,cksumtype);
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/node_configlog.sql b/upgrades/dbpatches/1.3/postgresql/patch/node_configlog.sql
index 121d5737..4e3fe54c 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/node_configlog.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/node_configlog.sql
@@ -1,12 +1,12 @@
CREATE TABLE node_configlog (
- conflogid bigint unsigned DEFAULT '0' NOT NULL,
- nodeid bigint unsigned DEFAULT '0' NOT NULL,
- tablename varchar(64) DEFAULT '' NOT NULL,
- recordid bigint unsigned DEFAULT '0' NOT NULL,
- operation integer DEFAULT '0' NOT NULL,
- sync_master integer DEFAULT '0' NOT NULL,
- sync_slave integer DEFAULT '0' NOT NULL,
+ conflogid bigint DEFAULT '0' NOT NULL,
+ nodeid bigint DEFAULT '0' NOT NULL,
+ tablename varchar(64) DEFAULT '' NOT NULL,
+ recordid bigint DEFAULT '0' NOT NULL,
+ operation integer DEFAULT '0' NOT NULL,
+ sync_master integer DEFAULT '0' NOT NULL,
+ sync_slave integer DEFAULT '0' NOT NULL,
PRIMARY KEY (nodeid,conflogid)
-) ENGINE=InnoDB;
+);
CREATE INDEX node_configlog_configlog_1 on node_configlog (conflogid);
CREATE INDEX node_configlog_configlog_2 on node_configlog (nodeid,tablename);
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/nodes.sql b/upgrades/dbpatches/1.3/postgresql/patch/nodes.sql
index 40be6161..9054c83b 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/nodes.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/nodes.sql
@@ -1,16 +1,16 @@
CREATE TABLE nodes (
nodeid integer DEFAULT '0' NOT NULL,
name varchar(64) DEFAULT '0' NOT NULL,
- timezone integer DEFAULT '0' NOT NULL,
+ timezone integer DEFAULT '0' NOT NULL,
ip varchar(15) DEFAULT '' NOT NULL,
port integer DEFAULT '10051' NOT NULL,
- slave_history integer DEFAULT '30' NOT NULL,
- slave_trends integer DEFAULT '365' NOT NULL,
- event_lastid bigint unsigned DEFAULT '0' NOT NULL,
- history_lastid bigint unsigned DEFAULT '0' NOT NULL,
- history_str_lastid bigint unsigned DEFAULT '0' NOT NULL,
- history_uint_lastid bigint unsigned DEFAULT '0' NOT NULL,
+ slave_history integer DEFAULT '30' NOT NULL,
+ slave_trends integer DEFAULT '365' NOT NULL,
+ event_lastid bigint DEFAULT '0' NOT NULL,
+ history_lastid bigint DEFAULT '0' NOT NULL,
+ history_str_lastid bigint DEFAULT '0' NOT NULL,
+ history_uint_lastid bigint DEFAULT '0' NOT NULL,
nodetype integer DEFAULT '0' NOT NULL,
masterid integer DEFAULT '0' NOT NULL,
PRIMARY KEY (nodeid)
-) ENGINE=InnoDB;
+);
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/profiles.sql b/upgrades/dbpatches/1.3/postgresql/patch/profiles.sql
index ba8e374d..f56a5c0f 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/profiles.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/profiles.sql
@@ -1,27 +1,27 @@
CREATE TABLE profiles_tmp (
- profileid bigint unsigned NOT NULL auto_increment,
- userid bigint unsigned DEFAULT '0' NOT NULL,
+ profileid bigint DEFAULT '0' NOT NULL,
+ userid bigint DEFAULT '0' NOT NULL,
idx varchar(64) DEFAULT '' NOT NULL,
value varchar(255) DEFAULT '' NOT NULL,
- valuetype integer DEFAULT 0 NOT NULL,
+ valuetype integer DEFAULT 0 NOT NULL,
PRIMARY KEY (profileid)
-) ENGINE=InnoDB;
+);
CREATE UNIQUE INDEX profiles_1 on profiles_tmp (userid,idx);
insert into profiles_tmp select NULL,userid,idx,value,valuetype from profiles;
drop table profiles;
-alter table profiles_tmp rename profiles;
+alter table profiles_tmp rename to profiles;
CREATE TABLE profiles_tmp (
- profileid bigint unsigned DEFAULT '0' NOT NULL,
- userid bigint unsigned DEFAULT '0' NOT NULL,
+ profileid bigint DEFAULT '0' NOT NULL,
+ userid bigint DEFAULT '0' NOT NULL,
idx varchar(64) DEFAULT '' NOT NULL,
value varchar(255) DEFAULT '' NOT NULL,
- valuetype integer DEFAULT 0 NOT NULL,
+ valuetype integer DEFAULT 0 NOT NULL,
PRIMARY KEY (profileid)
-) ENGINE=InnoDB;
+);
CREATE UNIQUE INDEX profiles_1 on profiles_tmp (userid,idx);
insert into profiles_tmp select * from profiles;
drop table profiles;
-alter table profiles_tmp rename profiles;
+alter table profiles_tmp rename to profiles;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/rights.sql b/upgrades/dbpatches/1.3/postgresql/patch/rights.sql
index d009ecf2..9f3d6abf 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/rights.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/rights.sql
@@ -1,13 +1,13 @@
CREATE TABLE rights_tmp (
- rightid bigint unsigned DEFAULT '0' NOT NULL,
- groupid bigint unsigned DEFAULT '0' NOT NULL,
+ rightid bigint DEFAULT '0' NOT NULL,
+ groupid bigint DEFAULT '0' NOT NULL,
type integer DEFAULT '0' NOT NULL,
- permission integer DEFAULT '0' NOT NULL,
- id bigint unsigned ,
+ permission integer DEFAULT '0' NOT NULL,
+ id bigint,
PRIMARY KEY (rightid)
-) ENGINE=InnoDB;
+);
CREATE INDEX rights_1 on rights_tmp (groupid);
-insert into rights_tmp select * from rights;
+insert into rights_tmp select rightid,groupid,type::integer,permission,id from rights;
drop table rights;
-alter table rights_tmp rename rights;
+alter table rights_tmp rename to rights;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/screens.sql b/upgrades/dbpatches/1.3/postgresql/patch/screens.sql
index 6c55a4be..f3c42074 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/screens.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/screens.sql
@@ -1,11 +1,11 @@
CREATE TABLE screens_tmp (
- screenid bigint unsigned DEFAULT '0' NOT NULL,
+ screenid bigint DEFAULT '0' NOT NULL,
name varchar(255) DEFAULT 'Screen' NOT NULL,
hsize integer DEFAULT '1' NOT NULL,
vsize integer DEFAULT '1' NOT NULL,
PRIMARY KEY (screenid)
-) ENGINE=InnoDB;
+);
insert into screens_tmp select * from screens;
drop table screens;
-alter table screens_tmp rename screens;
+alter table screens_tmp rename to screens;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/screens_items.sql b/upgrades/dbpatches/1.3/postgresql/patch/screens_items.sql
index 2dabadae..d00811a6 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/screens_items.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/screens_items.sql
@@ -1,45 +1,45 @@
CREATE TABLE screens_items_tmp (
- screenitemid bigint unsigned NOT NULL auto_increment,
- screenid bigint unsigned DEFAULT '0' NOT NULL,
- resourcetype integer DEFAULT '0' NOT NULL,
- resourceid bigint unsigned DEFAULT '0' NOT NULL,
+ screenitemid bigint DEFAULT '0' NOT NULL,
+ screenid bigint DEFAULT '0' NOT NULL,
+ resourcetype integer DEFAULT '0' NOT NULL,
+ resourceid bigint DEFAULT '0' NOT NULL,
width integer DEFAULT '320' NOT NULL,
height integer DEFAULT '200' NOT NULL,
x integer DEFAULT '0' NOT NULL,
y integer DEFAULT '0' NOT NULL,
colspan integer DEFAULT '0' NOT NULL,
rowspan integer DEFAULT '0' NOT NULL,
- elements integer DEFAULT '25' NOT NULL,
+ elements integer DEFAULT '25' NOT NULL,
valign integer DEFAULT '0' NOT NULL,
halign integer DEFAULT '0' NOT NULL,
style integer DEFAULT '0' NOT NULL,
url varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (screenitemid)
-) ENGINE=InnoDB;
+);
insert into screens_items_tmp select NULL,screenid,resourcetype,resourceid,width,height,x,y,colspan,rowspan,elements,valign,halign,style,url from screens_items;
drop table screens_items;
-alter table screens_items_tmp rename screens_items;
+alter table screens_items_tmp rename to screens_items;
CREATE TABLE screens_items_tmp (
- screenitemid bigint unsigned DEFAULT '0' NOT NULL,
- screenid bigint unsigned DEFAULT '0' NOT NULL,
- resourcetype integer DEFAULT '0' NOT NULL,
- resourceid bigint unsigned DEFAULT '0' NOT NULL,
+ screenitemid bigint DEFAULT '0' NOT NULL,
+ screenid bigint DEFAULT '0' NOT NULL,
+ resourcetype integer DEFAULT '0' NOT NULL,
+ resourceid bigint DEFAULT '0' NOT NULL,
width integer DEFAULT '320' NOT NULL,
height integer DEFAULT '200' NOT NULL,
x integer DEFAULT '0' NOT NULL,
y integer DEFAULT '0' NOT NULL,
colspan integer DEFAULT '0' NOT NULL,
rowspan integer DEFAULT '0' NOT NULL,
- elements integer DEFAULT '25' NOT NULL,
+ elements integer DEFAULT '25' NOT NULL,
valign integer DEFAULT '0' NOT NULL,
halign integer DEFAULT '0' NOT NULL,
style integer DEFAULT '0' NOT NULL,
url varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (screenitemid)
-) ENGINE=InnoDB;
+);
insert into screens_items_tmp select * from screens_items;
drop table screens_items;
-alter table screens_items_tmp rename screens_items;
+alter table screens_items_tmp rename to screens_items;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/service_alarms.sql b/upgrades/dbpatches/1.3/postgresql/patch/service_alarms.sql
index 61b02bc9..f595afab 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/service_alarms.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/service_alarms.sql
@@ -1,13 +1,13 @@
CREATE TABLE service_alarms_tmp (
- servicealarmid bigint unsigned DEFAULT '0' NOT NULL,
- serviceid bigint unsigned DEFAULT '0' NOT NULL,
+ servicealarmid bigint DEFAULT '0' NOT NULL,
+ serviceid bigint DEFAULT '0' NOT NULL,
clock integer DEFAULT '0' NOT NULL,
value integer DEFAULT '0' NOT NULL,
PRIMARY KEY (servicealarmid)
-) ENGINE=InnoDB;
+);
CREATE INDEX service_alarms_1 on service_alarms_tmp (serviceid,clock);
CREATE INDEX service_alarms_2 on service_alarms_tmp (clock);
insert into service_alarms_tmp select * from service_alarms;
drop table service_alarms;
-alter table service_alarms_tmp rename service_alarms;
+alter table service_alarms_tmp rename to service_alarms;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/services.sql b/upgrades/dbpatches/1.3/postgresql/patch/services.sql
index d6578969..efafc4e5 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/services.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/services.sql
@@ -1,15 +1,15 @@
CREATE TABLE services_tmp (
- serviceid bigint unsigned DEFAULT '0' NOT NULL,
+ serviceid bigint DEFAULT '0' NOT NULL,
name varchar(128) DEFAULT '' NOT NULL,
status integer DEFAULT '0' NOT NULL,
- algorithm integer DEFAULT '0' NOT NULL,
- triggerid bigint unsigned ,
+ algorithm integer DEFAULT '0' NOT NULL,
+ triggerid bigint ,
showsla integer DEFAULT '0' NOT NULL,
- goodsla double(5,2) DEFAULT '99.9' NOT NULL,
- sortorder integer DEFAULT '0' NOT NULL,
+ goodsla numeric(5,2) DEFAULT '99.9' NOT NULL,
+ sortorder integer DEFAULT '0' NOT NULL,
PRIMARY KEY (serviceid)
-) ENGINE=InnoDB;
+);
insert into services_tmp select * from services;
drop table services;
-alter table services_tmp rename services;
+alter table services_tmp rename to services;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/services_links.sql b/upgrades/dbpatches/1.3/postgresql/patch/services_links.sql
index 0eadfb2a..2e5e9253 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/services_links.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/services_links.sql
@@ -1,13 +1,13 @@
CREATE TABLE services_links_tmp (
- linkid bigint unsigned DEFAULT '0' NOT NULL,
- serviceupid bigint unsigned DEFAULT '0' NOT NULL,
- servicedownid bigint unsigned DEFAULT '0' NOT NULL,
+ linkid bigint DEFAULT '0' NOT NULL,
+ serviceupid bigint DEFAULT '0' NOT NULL,
+ servicedownid bigint DEFAULT '0' NOT NULL,
soft integer DEFAULT '0' NOT NULL,
PRIMARY KEY (linkid)
-) ENGINE=InnoDB;
+);
CREATE INDEX services_links_links_1 on services_links_tmp (servicedownid);
CREATE UNIQUE INDEX services_links_links_2 on services_links_tmp (serviceupid,servicedownid);
insert into services_links_tmp select * from services_links;
drop table services_links;
-alter table services_links_tmp rename services_links;
+alter table services_links_tmp rename to services_links;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/services_times.sql b/upgrades/dbpatches/1.3/postgresql/patch/services_times.sql
index 1e8190a2..e9e2e305 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/services_times.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/services_times.sql
@@ -1,10 +1,10 @@
CREATE TABLE services_times (
- timeid bigint unsigned DEFAULT '0' NOT NULL,
- serviceid bigint unsigned DEFAULT '0' NOT NULL,
+ timeid bigint DEFAULT '0' NOT NULL,
+ serviceid bigint DEFAULT '0' NOT NULL,
type integer DEFAULT '0' NOT NULL,
ts_from integer DEFAULT '0' NOT NULL,
ts_to integer DEFAULT '0' NOT NULL,
note varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (timeid)
-) ENGINE=InnoDB;
+);
CREATE INDEX services_times_times_1 on services_times (serviceid,type,ts_from,ts_to);
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/sessions.sql b/upgrades/dbpatches/1.3/postgresql/patch/sessions.sql
index 55d4a669..d9d3d45d 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/sessions.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/sessions.sql
@@ -1,10 +1,10 @@
CREATE TABLE sessions_tmp (
- sessionid varchar(32) DEFAULT '' NOT NULL,
- userid bigint unsigned DEFAULT '0' NOT NULL,
- lastaccess integer DEFAULT '0' NOT NULL,
+ sessionid varchar(32) DEFAULT '' NOT NULL,
+ userid bigint DEFAULT '0' NOT NULL,
+ lastaccess integer DEFAULT '0' NOT NULL,
PRIMARY KEY (sessionid)
-) ENGINE=InnoDB;
+);
insert into sessions_tmp select * from sessions;
drop table sessions;
-alter table sessions_tmp rename sessions;
+alter table sessions_tmp rename to sessions;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/sysmaps.sql b/upgrades/dbpatches/1.3/postgresql/patch/sysmaps.sql
index b357e8e8..7652219c 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/sysmaps.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/sysmaps.sql
@@ -1,15 +1,15 @@
CREATE TABLE sysmaps_tmp (
- sysmapid bigint unsigned DEFAULT '0' NOT NULL,
+ sysmapid bigint DEFAULT '0' NOT NULL,
name varchar(128) DEFAULT '' NOT NULL,
width integer DEFAULT '0' NOT NULL,
height integer DEFAULT '0' NOT NULL,
- backgroundid bigint unsigned DEFAULT '0' NOT NULL,
- label_type integer DEFAULT '0' NOT NULL,
- label_location integer DEFAULT '0' NOT NULL,
+ backgroundid bigint DEFAULT '0' NOT NULL,
+ label_type integer DEFAULT '0' NOT NULL,
+ label_location integer DEFAULT '0' NOT NULL,
PRIMARY KEY (sysmapid)
-) ENGINE=InnoDB;
+);
CREATE INDEX sysmaps_1 on sysmaps_tmp (name);
insert into sysmaps_tmp select * from sysmaps;
drop table sysmaps;
-alter table sysmaps_tmp rename sysmaps;
+alter table sysmaps_tmp rename to sysmaps;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/sysmaps_elements.sql b/upgrades/dbpatches/1.3/postgresql/patch/sysmaps_elements.sql
index 4d6f8a72..97fd7a8d 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/sysmaps_elements.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/sysmaps_elements.sql
@@ -1,18 +1,18 @@
CREATE TABLE sysmaps_elements_tmp (
- selementid bigint unsigned DEFAULT '0' NOT NULL,
- sysmapid bigint unsigned DEFAULT '0' NOT NULL,
- elementid bigint unsigned DEFAULT '0' NOT NULL,
- elementtype integer DEFAULT '0' NOT NULL,
- iconid_off bigint unsigned DEFAULT '0' NOT NULL,
- iconid_on bigint unsigned DEFAULT '0' NOT NULL,
+ selementid bigint DEFAULT '0' NOT NULL,
+ sysmapid bigint DEFAULT '0' NOT NULL,
+ elementid bigint DEFAULT '0' NOT NULL,
+ elementtype integer DEFAULT '0' NOT NULL,
+ iconid_off bigint DEFAULT '0' NOT NULL,
+ iconid_on bigint DEFAULT '0' NOT NULL,
label varchar(128) DEFAULT '' NOT NULL,
- label_location integer NULL,
+ label_location integer NULL,
x integer DEFAULT '0' NOT NULL,
y integer DEFAULT '0' NOT NULL,
url varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (selementid)
-) ENGINE=InnoDB;
+);
insert into sysmaps_elements_tmp select * from sysmaps_elements;
drop table sysmaps_elements;
-alter table sysmaps_elements_tmp rename sysmaps_elements;
+alter table sysmaps_elements_tmp rename to sysmaps_elements;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/sysmaps_links.sql b/upgrades/dbpatches/1.3/postgresql/patch/sysmaps_links.sql
index f0e4ffef..9ae49130 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/sysmaps_links.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/sysmaps_links.sql
@@ -1,16 +1,16 @@
CREATE TABLE sysmaps_links_tmp (
- linkid bigint unsigned DEFAULT '0' NOT NULL,
- sysmapid bigint unsigned DEFAULT '0' NOT NULL,
- selementid1 bigint unsigned DEFAULT '0' NOT NULL,
- selementid2 bigint unsigned DEFAULT '0' NOT NULL,
- triggerid bigint unsigned ,
- drawtype_off integer DEFAULT '0' NOT NULL,
- color_off varchar(32) DEFAULT 'Black' NOT NULL,
- drawtype_on integer DEFAULT '0' NOT NULL,
- color_on varchar(32) DEFAULT 'Red' NOT NULL,
+ linkid bigint DEFAULT '0' NOT NULL,
+ sysmapid bigint DEFAULT '0' NOT NULL,
+ selementid1 bigint DEFAULT '0' NOT NULL,
+ selementid2 bigint DEFAULT '0' NOT NULL,
+ triggerid bigint ,
+ drawtype_off integer DEFAULT '0' NOT NULL,
+ color_off varchar(32) DEFAULT 'Black' NOT NULL,
+ drawtype_on integer DEFAULT '0' NOT NULL,
+ color_on varchar(32) DEFAULT 'Red' NOT NULL,
PRIMARY KEY (linkid)
-) ENGINE=InnoDB;
+);
insert into sysmaps_links_tmp select * from sysmaps_links;
drop table sysmaps_links;
-alter table sysmaps_links_tmp rename sysmaps_links;
+alter table sysmaps_links_tmp rename to sysmaps_links;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/trends.sql b/upgrades/dbpatches/1.3/postgresql/patch/trends.sql
index 8694167a..7e10db00 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/trends.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/trends.sql
@@ -1,13 +1,13 @@
CREATE TABLE trends_tmp (
- itemid bigint unsigned DEFAULT '0' NOT NULL,
+ itemid bigint DEFAULT '0' NOT NULL,
clock integer DEFAULT '0' NOT NULL,
num integer DEFAULT '0' NOT NULL,
- value_min double(16,4) DEFAULT '0.0000' NOT NULL,
- value_avg double(16,4) DEFAULT '0.0000' NOT NULL,
- value_max double(16,4) DEFAULT '0.0000' NOT NULL,
+ value_min numeric(16,4) DEFAULT '0.0000' NOT NULL,
+ value_avg numeric(16,4) DEFAULT '0.0000' NOT NULL,
+ value_max numeric(16,4) DEFAULT '0.0000' NOT NULL,
PRIMARY KEY (itemid,clock)
-) ENGINE=InnoDB;
+);
insert into trends_tmp select * from trends;
drop table trends;
-alter table trends_tmp rename trends;
+alter table trends_tmp rename to trends;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/trigger_depends.sql b/upgrades/dbpatches/1.3/postgresql/patch/trigger_depends.sql
index 193de545..0a1974db 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/trigger_depends.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/trigger_depends.sql
@@ -1,25 +1,25 @@
CREATE TABLE trigger_depends_tmp (
- triggerdepid bigint unsigned NOT NULL auto_increment,
- triggerid_down bigint unsigned DEFAULT '0' NOT NULL,
- triggerid_up bigint unsigned DEFAULT '0' NOT NULL,
+ triggerdepid bigint DEFAULT '0' NOT NULL,
+ triggerid_down bigint DEFAULT '0' NOT NULL,
+ triggerid_up bigint DEFAULT '0' NOT NULL,
PRIMARY KEY (triggerdepid)
-) ENGINE=InnoDB;
+);
CREATE INDEX trigger_depends_1 on trigger_depends_tmp (triggerid_down,triggerid_up);
CREATE INDEX trigger_depends_2 on trigger_depends_tmp (triggerid_up);
insert into trigger_depends_tmp select NULL,triggerid_down,triggerid_up from trigger_depends;
drop table trigger_depends;
-alter table trigger_depends_tmp rename trigger_depends;
+alter table trigger_depends_tmp rename to trigger_depends;
CREATE TABLE trigger_depends_tmp (
- triggerdepid bigint unsigned DEFAULT '0' NOT NULL,
- triggerid_down bigint unsigned DEFAULT '0' NOT NULL,
- triggerid_up bigint unsigned DEFAULT '0' NOT NULL,
+ triggerdepid bigint DEFAULT '0' NOT NULL,
+ triggerid_down bigint DEFAULT '0' NOT NULL,
+ triggerid_up bigint DEFAULT '0' NOT NULL,
PRIMARY KEY (triggerdepid)
-) ENGINE=InnoDB;
+);
CREATE INDEX trigger_depends_1 on trigger_depends_tmp (triggerid_down,triggerid_up);
CREATE INDEX trigger_depends_2 on trigger_depends_tmp (triggerid_up);
insert into trigger_depends_tmp select * from trigger_depends;
drop table trigger_depends;
-alter table trigger_depends_tmp rename trigger_depends;
+alter table trigger_depends_tmp rename to trigger_depends;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/triggers.sql b/upgrades/dbpatches/1.3/postgresql/patch/triggers.sql
index 1d03e406..57c348d0 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/triggers.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/triggers.sql
@@ -1,21 +1,21 @@
CREATE TABLE triggers_tmp (
- triggerid bigint unsigned DEFAULT '0' NOT NULL,
- expression varchar(255) DEFAULT '' NOT NULL,
- description varchar(255) DEFAULT '' NOT NULL,
+ triggerid bigint DEFAULT '0' NOT NULL,
+ expression varchar(255) DEFAULT '' NOT NULL,
+ description varchar(255) DEFAULT '' NOT NULL,
url varchar(255) DEFAULT '' NOT NULL,
status integer DEFAULT '0' NOT NULL,
value integer DEFAULT '0' NOT NULL,
- priority integer DEFAULT '0' NOT NULL,
- lastchange integer DEFAULT '0' NOT NULL,
- dep_level integer DEFAULT '0' NOT NULL,
- comments blob ,
+ priority integer DEFAULT '0' NOT NULL,
+ lastchange integer DEFAULT '0' NOT NULL,
+ dep_level integer DEFAULT '0' NOT NULL,
+ comments text ,
error varchar(128) DEFAULT '' NOT NULL,
- templateid bigint unsigned DEFAULT '0' NOT NULL,
+ templateid bigint DEFAULT '0' NOT NULL,
PRIMARY KEY (triggerid)
-) ENGINE=InnoDB;
+);
CREATE INDEX triggers_1 on triggers_tmp (status);
CREATE INDEX triggers_2 on triggers_tmp (value);
insert into triggers_tmp select * from triggers;
drop table triggers;
-alter table triggers_tmp rename triggers;
+alter table triggers_tmp rename to triggers;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/users.sql b/upgrades/dbpatches/1.3/postgresql/patch/users.sql
index fcad30a5..ac094cfe 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/users.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/users.sql
@@ -1,18 +1,18 @@
CREATE TABLE users_tmp (
- userid bigint unsigned DEFAULT '0' NOT NULL,
+ userid bigint DEFAULT '0' NOT NULL,
alias varchar(100) DEFAULT '' NOT NULL,
name varchar(100) DEFAULT '' NOT NULL,
surname varchar(100) DEFAULT '' NOT NULL,
passwd char(32) DEFAULT '' NOT NULL,
url varchar(255) DEFAULT '' NOT NULL,
- autologout integer DEFAULT '900' NOT NULL,
+ autologout integer DEFAULT '900' NOT NULL,
lang varchar(5) DEFAULT 'en_gb' NOT NULL,
refresh integer DEFAULT '30' NOT NULL,
type integer DEFAULT '0' NOT NULL,
PRIMARY KEY (userid)
-) ENGINE=InnoDB;
+);
CREATE INDEX users_1 on users_tmp (alias);
insert into users_tmp select userid,alias,name,surname,passwd,url,autologout,lang,refresh,3 from users;
drop table users;
-alter table users_tmp rename users;
+alter table users_tmp rename to users;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/users_groups.sql b/upgrades/dbpatches/1.3/postgresql/patch/users_groups.sql
index 1b45595b..abe3866b 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/users_groups.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/users_groups.sql
@@ -1,23 +1,23 @@
CREATE TABLE users_groups_tmp (
- id bigint unsigned NOT NULL auto_increment,
- usrgrpid bigint unsigned DEFAULT '0' NOT NULL,
- userid bigint unsigned DEFAULT '0' NOT NULL,
+ id bigint DEFAULT '0' NOT NULL,
+ usrgrpid bigint DEFAULT '0' NOT NULL,
+ userid bigint DEFAULT '0' NOT NULL,
PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
CREATE INDEX users_groups_1 on users_groups_tmp (usrgrpid,userid);
insert into users_groups_tmp select NULL,usrgrpid,userid from users_groups;
drop table users_groups;
-alter table users_groups_tmp rename users_groups;
+alter table users_groups_tmp rename to users_groups;
CREATE TABLE users_groups_tmp (
- id bigint unsigned DEFAULT '0' NOT NULL,
- usrgrpid bigint unsigned DEFAULT '0' NOT NULL,
- userid bigint unsigned DEFAULT '0' NOT NULL,
+ id bigint DEFAULT '0' NOT NULL,
+ usrgrpid bigint DEFAULT '0' NOT NULL,
+ userid bigint DEFAULT '0' NOT NULL,
PRIMARY KEY (id)
-) ENGINE=InnoDB;
+);
CREATE INDEX users_groups_1 on users_groups_tmp (usrgrpid,userid);
insert into users_groups_tmp select * from users_groups;
drop table users_groups;
-alter table users_groups_tmp rename users_groups;
+alter table users_groups_tmp rename to users_groups;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/usrgrp.sql b/upgrades/dbpatches/1.3/postgresql/patch/usrgrp.sql
index b9a9b9f6..5ad81ff7 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/usrgrp.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/usrgrp.sql
@@ -1,10 +1,10 @@
CREATE TABLE usrgrp_tmp (
- usrgrpid bigint unsigned DEFAULT '0' NOT NULL,
+ usrgrpid bigint DEFAULT '0' NOT NULL,
name varchar(64) DEFAULT '' NOT NULL,
PRIMARY KEY (usrgrpid)
-) ENGINE=InnoDB;
+);
CREATE INDEX usrgrp_1 on usrgrp_tmp (name);
insert into usrgrp_tmp select * from usrgrp;
drop table usrgrp;
-alter table usrgrp_tmp rename usrgrp;
+alter table usrgrp_tmp rename to usrgrp;
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/valuemaps.sql b/upgrades/dbpatches/1.3/postgresql/patch/valuemaps.sql
index 9febba47..addad09c 100644
--- a/upgrades/dbpatches/1.3/postgresql/patch/valuemaps.sql
+++ b/upgrades/dbpatches/1.3/postgresql/patch/valuemaps.sql
@@ -1,10 +1,10 @@
CREATE TABLE valuemaps_tmp (
- valuemapid bigint unsigned DEFAULT '0' NOT NULL,
+ valuemapid bigint DEFAULT '0' NOT NULL,
name varchar(64) DEFAULT '' NOT NULL,
PRIMARY KEY (valuemapid)
-) ENGINE=InnoDB;
+);
CREATE INDEX valuemaps_1 on valuemaps_tmp (name);
insert into valuemaps_tmp select * from valuemaps;
drop table valuemaps;
-alter table valuemaps_tmp rename valuemaps;
+alter table valuemaps_tmp rename to valuemaps;