Added new records to the 'type_of_issue' table.
[gnucomo.git] / src / database / create.sql
index 880d9c6..dc66c84 100644 (file)
 -- Before running this script with 'psql -f', you should have your
 -- DBA create the database and give access permissions.
 --
---  $log$
+--  $Log: create.sql,v $
+--  Revision 1.5  2003-01-18 08:46:48  arjen
+--  Added new records to the 'type_of_issue' table.
+--  Changed semantics of actionid 9 in the 'action' table.
+--
 --
 
 CREATE SEQUENCE "action_actionid_seq";
@@ -34,7 +38,7 @@ COPY "action" FROM stdin;
 6      Action taken    PEN     An action has been taken.
 7      Assignment to user      PEN     The notification has been assigned to an user.
 8      More information or research needed.    INV     The notification is relevant and will be handled, however more information or research will be needed. For that reason the status has been altered to UNDER INVESTIGATION.
-9      Make output reference   REF     The automated output from an object was sent to gnucomo. The input has been identified as a valid reference for the future. For that reason the status is now REFERENCE
+9      Investigation completed PEN     Investigation has been done. Information is available to fix the problem.
 10     Job output no longer valid      CLS     By making a newer job output a valid reference, this data has been obsoleted. Since it was a reference once the output isn't interesting anymore and thus the notification can be closed.
 11     Action taken - please verify    CLS     An action has been taken and things should have been resolved. Before the notification can be closed a verification has to be done. The new status is now VERIFY.
 12     Action not verified     PEN     A check has been done and the results were not good. New verification is needed. The status has been changed back to PEN.
@@ -99,7 +103,9 @@ CREATE TABLE "db_value"
 
 
 COPY "db_value" FROM stdin;
-db_version     1
+db_version     20
+gcm_daemon_version     1
+log_processing 0
 \.
 
 --
@@ -130,7 +136,8 @@ CREATE TABLE "log"
        "object_timestamp" timestamp with time zone,
        "timestamp" timestamp with time zone,
        "rawdata" text,
-       "processed" boolean
+       "processed" boolean DEFAULT false,
+        "recognized" boolean DEFAULT false
 );
 
 CREATE UNIQUE INDEX log_logid_key ON log USING btree (logid);
@@ -152,8 +159,6 @@ CREATE INDEX log_processed ON log USING btree (processed);
 SELECT setval ('"log_logid_seq"', 1, false);
 
 
-CREATE RULE log_update AS ON UPDATE TO log DO INSTEAD NOTHING;
-
 --
 --
 
@@ -164,7 +169,8 @@ CREATE TABLE "log_adv"
 (
        "log_advid" bigint DEFAULT
               nextval('"log_advid_seq"'::text) NOT NULL,
-       "logid" bigint NOT NULL
+       "logid" bigint NOT NULL,
+       "detailed_table"    text
 );
 
 
@@ -174,6 +180,34 @@ CREATE UNIQUE INDEX log_adv_log_advid ON log_adv USING btree (log_advid);
 
 SELECT setval ('"log_advid_seq"', 1, false);
 
+CREATE TABLE log_adv_kernel_network
+(
+       device_in         text,
+       device_out        text,
+       hw_address        text, 
+       source_ip         INET,
+       destination_ip    INET,
+       packet_length     bigint, 
+       tos_bit           text, 
+       prec_bit          text,
+       ttl               int,
+       header_id         bigint,
+       source_port       int, 
+       destination_port  int,
+       body_length       int,
+       protocol          text, 
+       body_len          int,
+       window            text,
+       urgp              int,
+       syn               boolean DEFAULT false,
+       type              int,
+       code              int,
+       sequence_number   int,
+       res               text,
+       rst               boolean,
+       df                boolean
+) INHERITS (log_adv);
+
 
 /*
 CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql' HANDLER "plpgsql_call_handler" LANCOMPILER '';
@@ -272,7 +306,9 @@ CREATE TABLE "object"
        "object_owner" text,
        "physical_location" text,
        "timezone" text,
-       "remark" text
+       "remark" text,
+        "os"     text,
+        "os_version"   text
 );
 
 CREATE UNIQUE INDEX object_objectid_key ON object USING btree (objectid);
@@ -283,6 +319,10 @@ CREATE UNIQUE INDEX obj_objectcode ON object USING btree (objectcode);
 
 CREATE INDEX obj_mail_from ON object USING btree (mail_from);
 
+CREATE INDEX os ON object (os);
+
+CREATE INDEX os_version ON object (os, os_version);
+
 SELECT setval ('"object_objectid_seq"', 1, false);
 
 --
@@ -471,6 +511,17 @@ CREATE INDEX sta_open_notification ON status USING btree (open_notification);
 --
 --
 
+CREATE TABLE supported_os
+(
+    os_name text,
+    remarks text
+);
+
+CREATE UNIQUE INDEX spp_os ON supported_os (os_name);
+
+--
+--
+
 CREATE SEQUENCE "type_of_issue_type_of_issue_seq";
 
 CREATE TABLE "type_of_issue"
@@ -480,12 +531,19 @@ CREATE TABLE "type_of_issue"
        "name" text,
        "suggested_priority" text,
        "description" text,
-       "active" boolean
+       "active" boolean,
+        automated_check       boolean,
+        alert_level           int,
+        last_run              timestamp,
+        recheck_interval      timestamp
 );
 
 
 COPY "type_of_issue" FROM stdin;
 1      manual entry    4       A manual entry of a notification        t
+2      parameter created       3       A new parameter was created     t
+3      property modified       3       The STATIC property of a parameter was modified t
+4      parameter removed       3       A parameter was removed t
 \.
 
 CREATE UNIQUE INDEX type_of_issue_type_of_issue_key ON type_of_issue USING btree (type_of_issueid);
@@ -494,7 +552,7 @@ CREATE UNIQUE INDEX toi_name ON type_of_issue USING btree (name);
 
 CREATE INDEX toi_active ON type_of_issue USING btree (active);
 
-SELECT setval ('"type_of_issue_type_of_issue_seq"', 1, true);
+SELECT setval ('"type_of_issue_type_of_issue_seq"', 4, true);
 
 --
 --