/*==============================================================*/
/* Table: USERDOCHISTORIES                                      */
/*==============================================================*/
create table USERDOCHISTORIES (
USERID               INTEGER                        not null,
DOCUMENTID           INTEGER                        not null,
LASTACCESSED         TIMESTAMP                      not null,
constraint PK_USERDOCHISTORIES primary key (USERID, DOCUMENTID)
);

alter table USERDOCHISTORIES
   add constraint FK_USERDOCHISTORIES1 foreign key (DOCUMENTID)
      references DOCUMENTS (DOCUMENTID);

alter table USERDOCHISTORIES
   add constraint FK_USERDOCHISTORIES2 foreign key (USERID)
      references USERS (USERID);

update SYSPARAMETERS set VALUESTRING = '1'  where CONTEXT = 'SYSTEMINFO' and name = 'DBVersionHigh';
update SYSPARAMETERS set VALUESTRING = '87' where CONTEXT = 'SYSTEMINFO' and name = 'DBVersionLow';
update SYSPARAMETERS set VALUESTRING = '2004-04-30' where CONTEXT = 'SYSTEMINFO' and name = 'DBCreationDate';
      
commit;
