CREATE TABLE contacthist (
 id serial,

 contact integer default '1',
--HELP_EN_INFO:contact
--HELP_EN_LONG:The person to whom this status applies
--HELP_NL_INFO:gebruiker
--HELP_NL_LONG:De medewerker voor wie deze status geldt.

 sessionid varchar(50) NOT NULL default '',
--HELP_EN_INFO:
--HELP_EN_LONG:
--HELP_NL_INFO:
--HELP_NL_LONG:

 call_seq integer NOT NULL default '1',
--HELP_EN_INFO:
--HELP_EN_LONG:
--HELP_NL_INFO:
--HELP_NL_LONG:

 stamp timestamp with time zone NOT NULL default CURRENT_TIMESTAMP,
--HELP_EN_INFO:
--HELP_EN_LONG:
--HELP_NL_INFO:
--HELP_NL_LONG:

 event integer NOT NULL default '0',
--HELP_EN_INFO:
--HELP_EN_LONG:
--HELP_NL_INFO:
--HELP_NL_LONG:

 int1 integer NOT NULL default '0',
--HELP_EN_INFO:
--HELP_EN_LONG:
--HELP_NL_INFO:
--HELP_NL_LONG:

 int2 integer NOT NULL default '0',
--HELP_EN_INFO:
--HELP_EN_LONG:
--HELP_NL_INFO:
--HELP_NL_LONG:

 parm1 varchar(255) NOT NULL default '',
--HELP_EN_INFO:
--HELP_EN_LONG:
--HELP_NL_INFO:
--HELP_NL_LONG:

 parm2 varchar(40) NOT NULL default '',
--HELP_EN_INFO:
--HELP_EN_LONG:
--HELP_NL_INFO:
--HELP_NL_LONG:

 PRIMARY KEY  (id)
);

CREATE INDEX contacthist_sessionid_index ON contacthist (sessionid);
CREATE INDEX contacthist_sessionid_call_seq_index ON contacthist (sessionid, call_seq);
CREATE INDEX contacthist_contact_index ON contacthist (contact);
CREATE INDEX contacthist_stamp_index ON contacthist (stamp);
CREATE INDEX contacthist_event_index ON contacthist (event);

GRANT UPDATE, SELECT, INSERT, DELETE ON contacthist TO astium;
