update SYSPARAMETERS set VALUESTRING = '1'  where CONTEXT = 'SYSTEMINFO' and name = 'DBVersionHigh';
update SYSPARAMETERS set VALUESTRING = '173' where CONTEXT = 'SYSTEMINFO' and name = 'DBVersionLow';
update SYSPARAMETERS set VALUESTRING = '2006-07-05' where CONTEXT = 'SYSTEMINFO' and name = 'DBCreationDate';
/*==============================================================*/
/* Table: USERPROJECTHISTORIES                                      */
/*==============================================================*/
create table USERPROJECTHISTORIES (
USERID               INTEGER                        not null,
PROJECTID            INTEGER                        not null,
LASTACCESSED         TIMESTAMP                      not null,
constraint PK_USERPROJECTHISTORIES primary key (USERID, PROJECTID),
constraint FK_USERPROJECTHISTORIES1 foreign key (USERID) references USERS (USERID) ON DELETE CASCADE,
constraint FK_USERPROJECTHISTORIES2 foreign key (PROJECTID) references CATEGORIES (CATEGORYID) ON DELETE CASCADE
);
/*==============================================================*/
/* Table: USERFUNCTIONALHISTORIES                                      */
/*==============================================================*/
create table USERFUNCTIONALHISTORIES (
USERID               INTEGER                        not null,
FUNCTIONALID         INTEGER                        not null,
LASTACCESSED         TIMESTAMP                      not null,
constraint PK_USERFUNCTIONALHISTORIES primary key (USERID, FUNCTIONALID),
constraint FK_USERFUNCTIONALHISTORIES1 foreign key (USERID) references USERS (USERID) ON DELETE CASCADE,
constraint FK_USERFUNCTIONALHISTORIES2 foreign key (FUNCTIONALID) references CATEGORIES (CATEGORYID) ON DELETE CASCADE
);
commit;