Index: trunk/sql_init/samhain.mysql.init
===================================================================
--- trunk/sql_init/samhain.mysql.init	(revision 583)
+++ trunk/sql_init/samhain.mysql.init	(revision 1)
@@ -1,3 +1,5 @@
 CREATE DATABASE samhain;
+USE mysql;
+INSERT INTO db (Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv) VALUES ('localhost','samhain','','N','Y','N','N','N','N');
 USE samhain;
 CREATE TABLE    samhain.log (
@@ -31,5 +33,5 @@
   	return_code   INTEGER,
   	syscall       VARCHAR(16),
-  	ip            VARCHAR(46),
+  	ip            VARCHAR(16),
   	tty           VARCHAR(16),
         peer          VARCHAR(64),
@@ -68,27 +70,23 @@
         link_new      BLOB,
 	
-        size_old      BIGINT UNSIGNED,
-        size_new      BIGINT UNSIGNED,
-        hardlinks_old BIGINT UNSIGNED,
-        hardlinks_new BIGINT UNSIGNED,
-        inode_old     BIGINT UNSIGNED,
-        inode_new     BIGINT UNSIGNED,
+        size_old      BIGINT,
+        size_new      BIGINT,
+        hardlinks_old BIGINT,
+        hardlinks_new BIGINT,
+        inode_old     BIGINT,
+        inode_new     BIGINT,
 
-	imode_old     BIGINT UNSIGNED,
-	imode_new     BIGINT UNSIGNED,
-	iattr_old     BIGINT UNSIGNED,
-	iattr_new     BIGINT UNSIGNED,
-	idevice_old   BIGINT UNSIGNED,
-	idevice_new   BIGINT UNSIGNED,
-	iowner_old    BIGINT UNSIGNED,
-	iowner_new    BIGINT UNSIGNED,
-	igroup_old    BIGINT UNSIGNED,
-	igroup_new    BIGINT UNSIGNED,
-	checkflags_old    BIGINT UNSIGNED,
-	checkflags_new    BIGINT UNSIGNED,
+	imode_old     BIGINT,
+	imode_new     BIGINT,
+	iattr_old     BIGINT,
+	iattr_new     BIGINT,
+	idevice_old   BIGINT,
+	idevice_new   BIGINT,
+	iowner_old    BIGINT,
+	iowner_new    BIGINT,
+	igroup_old    BIGINT,
+	igroup_new    BIGINT
 	
 
-        acl_old       BLOB,
-        acl_new       BLOB
                  
         );
Index: trunk/sql_init/samhain.oracle.init
===================================================================
--- trunk/sql_init/samhain.oracle.init	(revision 583)
+++ trunk/sql_init/samhain.oracle.init	(revision 1)
@@ -9,5 +9,5 @@
         log_hash  VARCHAR2(32),
         entry_status  VARCHAR2(16) DEFAULT 'NEW' NOT NULL,
-        path          CLOB,         
+        path          VARCHAR2(4000),         
         userid        VARCHAR2(8),
         grp           VARCHAR2(8),
@@ -24,13 +24,13 @@
         return_code   INTEGER,
         syscall       VARCHAR2(16),
-        ip            VARCHAR2(46),
+        ip            VARCHAR2(16),
         tty           VARCHAR2(16),
         peer          VARCHAR2(64),
         fromhost      VARCHAR2(64),
-        obj           VARCHAR2(4000),
+        obj           VARCHAR2(128),
         interface     VARCHAR2(64),
         time          VARCHAR2(64),
-        dir           CLOB,
-        linked_path   CLOB,
+        dir           VARCHAR2(4000),
+        linked_path   VARCHAR2(4000),
         port          INTEGER,
         service       VARCHAR2(64),
@@ -56,6 +56,6 @@
         chksum_old    VARCHAR2(50),
         chksum_new    VARCHAR2(50),
-        link_old      CLOB,
-        link_new      CLOB,
+        link_old      VARCHAR2(4000),
+        link_new      VARCHAR2(4000),
         size_old      NUMBER(20),
         size_new      NUMBER(20),
@@ -73,10 +73,17 @@
         iowner_new    NUMBER(20),
         igroup_old    NUMBER(20),
-        igroup_new    NUMBER(20),
-        checkflags_old    NUMBER(20),
-        checkflags_new    NUMBER(20),
-        acl_old       VARCHAR2(4000),
-        acl_new       VARCHAR2(4000)
+        igroup_new    NUMBER(20)
         );
+
+CREATE OR REPLACE TRIGGER trigger_on_log
+before insert on log
+for each row
+declare
+log_index integer;
+begin
+select log_log_index_seq.NEXTVAL into :new.log_index from dual;
+end trigger_on_log;
+.
+run;
 
 CREATE UNIQUE INDEX log_log_index_key on log (log_index);
Index: trunk/sql_init/samhain.postgres.init
===================================================================
--- trunk/sql_init/samhain.postgres.init	(revision 583)
+++ trunk/sql_init/samhain.postgres.init	(revision 1)
@@ -1,5 +1,5 @@
 CREATE SEQUENCE log_log_index_seq START 1;
 CREATE TABLE    log (
-	log_index INTEGER NOT NULL,
+	log_index INTEGER NOT NULL DEFAULT NEXTVAL('log_log_index_seq'),
 	log_ref   BIGINT NULL,
 	log_host  VARCHAR(64)   NOT NULL DEFAULT 'localhost',
@@ -27,5 +27,5 @@
   	return_code   INTEGER,
   	syscall       VARCHAR(16),
-  	ip            VARCHAR(46),
+  	ip            VARCHAR(16),
   	tty           VARCHAR(16),
         peer          VARCHAR(64),
@@ -64,26 +64,22 @@
         link_new      TEXT,
 	
-        size_old      NUMERIC(20),
-        size_new      NUMERIC(20),
-        hardlinks_old NUMERIC(20),
-        hardlinks_new NUMERIC(20),
-        inode_old     NUMERIC(20),
-        inode_new     NUMERIC(20),
+        size_old      BIGINT,
+        size_new      BIGINT,
+        hardlinks_old BIGINT,
+        hardlinks_new BIGINT,
+        inode_old     BIGINT,
+        inode_new     BIGINT,
 
-	imode_old     NUMERIC(20),
-	imode_new     NUMERIC(20),
-	iattr_old     NUMERIC(20),
-	iattr_new     NUMERIC(20),
-	idevice_old   NUMERIC(20),
-	idevice_new   NUMERIC(20),
-	iowner_old    NUMERIC(20),
-	iowner_new    NUMERIC(20),
-	igroup_old    NUMERIC(20),
-	igroup_new    NUMERIC(20),
-	checkflags_old    NUMERIC(20),
-	checkflags_new    NUMERIC(20),
+	imode_old     BIGINT,
+	imode_new     BIGINT,
+	iattr_old     BIGINT,
+	iattr_new     BIGINT,
+	idevice_old   BIGINT,
+	idevice_new   BIGINT,
+	iowner_old    BIGINT,
+	iowner_new    BIGINT,
+	igroup_old    BIGINT,
+	igroup_new    BIGINT
                  
-        acl_old       TEXT,
-        acl_new       TEXT
         );
 
