X-Git-Url: http://www.andromeda.nl/gitweb/?p=gnucomo.git;a=blobdiff_plain;f=src%2Fdatabase%2Fcreate.sql;h=362fd862cb63cab765c782845cdfde5d21ee1d92;hp=b43289f0811f7bffec3176fcd9ec3d8d4e17d3a0;hb=4d57a7e6a9acd5f8ad538e3a4725ee4534d78c74;hpb=66ef806b6da939a527015ba77d3f33931e957f25 diff --git a/src/database/create.sql b/src/database/create.sql index b43289f..362fd86 100644 --- a/src/database/create.sql +++ b/src/database/create.sql @@ -12,7 +12,11 @@ -- DBA create the database and give access permissions. -- -- $Log: create.sql,v $ --- Revision 1.13 2003-03-29 08:27:05 arjen +-- Revision 1.14 2003-07-09 07:14:59 arjen +-- New database tables: notification_check, notification_check_buffer, +-- notification_check_line and object_statistics. +-- +-- Revision 1.13 2003/03/29 08:27:05 arjen -- New columns in the table 'log_adv_daemon_email': size, pri, relay, -- status_details and dsn. -- Added several indices for the table 'log_adv_daemon_email'. @@ -136,8 +140,8 @@ CREATE TABLE "db_value" COPY "db_value" FROM stdin; -db_version 36 -gcm_daemon_version 1 +db_version 41 +gcm_daemon_version 5 log_processing 0 last_notification 0 \. @@ -355,6 +359,73 @@ SELECT setval ('"notification_notificationid_seq"', 1, false); -- -- +CREATE SEQUENCE checkid_seq; + +CREATE TABLE notification_check +( + checkid bigint DEFAULT nextval('checkid_seq'::text) NOT NULL, + checkname TEXT, + description TEXT, + time_between_executions INTERVAL, + last_execution DATETIME, + execution_counter BIGINT, + notificationcounter BIGINT, + decreasinglist BOOLEAN default false, + type_of_issueid BIGINT +); + +CREATE UNIQUE INDEX not_check_checkid ON notification_check (checkid); + +CREATE UNIQUE INDEX not_check_checkname ON notification_check (checkname); + +CREATE INDEX not_check_check_lastexec ON notification_check (last_execution); + +-- +-- + +CREATE TABLE notification_check_buffer +( + checkid BIGINT, + sortorder INTEGER, + pid INTEGER, + logid bigint +); + +CREATE INDEX notcheckbuffer_checkid ON notification_check_buffer(checkid); + +CREATE INDEX notcheckbuffer_sort ON notification_check_buffer(sortorder); + +CREATE INDEX notcheckbuffer_pid ON notification_check_buffer(pid); + +CREATE INDEX notcheckbuffer_logid ON notification_check_buffer(logid); + +-- +-- + +CREATE SEQUENCE checklineid_seq; + +CREATE TABLE notification_check_line +( + checklineid BIGINT DEFAULT nextval('checklineid_seq'::text) NOT NULL, + checkid BIGINT, + sortorder INTEGER, + last_logid BIGINT default 0, + historicboundary INTERVAL default 0, + use_logid BOOLEAN default false, + sql_query TEXT +); + +CREATE UNIQUE INDEX notcheckline_checklineid ON notification_check_line (checklineid); + +CREATE INDEX notcheckline_checkid ON notification_check_line (checkid); + +CREATE INDEX notcheckline_sort ON notification_check_line (sortorder); + +CREATE INDEX notcheckline_check_sort ON notification_check_line (checkid, sortorder); + +-- +-- + CREATE SEQUENCE "object_objectid_seq"; CREATE TABLE "object" @@ -461,6 +532,20 @@ CREATE INDEX obs_accepted ON object_service USING btree (accepted); -- -- +CREATE TABLE object_statistics +( + objectid bigint, + statname text, + statvalue double precision, + + primary key (objectid, statname) +); + +CREATE INDEX obj_stat_objid ON object_statistics USING btree (objectid); + +-- +-- + CREATE TABLE "object_user" ( "objectid" bigint,