/*==============================================================*/
/* Table: USERCATFAVORITES                                      */
/*==============================================================*/
create table USERCATFAVORITES (
USERID               INTEGER                        not null,
CATEGORYID           INTEGER                        not null,
CREATED              TIMESTAMP,
constraint PK_USERCATFAVORITES primary key (USERID, CATEGORYID)
);


/*==============================================================*/
/* Table: USERDOCFAVORITES                                      */
/*==============================================================*/
create table USERDOCFAVORITES (
USERID               INTEGER                        not null,
DOCUMENTID           INTEGER                        not null,
CREATED              TIMESTAMP,
constraint PK_USERDOCFAVORITES primary key (USERID, DOCUMENTID)
);

update SYSPARAMETERS set VALUESTRING = '1'  where CONTEXT = 'SYSTEMINFO' and name = 'DBVersionHigh';
update SYSPARAMETERS set VALUESTRING = '85' where CONTEXT = 'SYSTEMINFO' and name = 'DBVersionLow';
update SYSPARAMETERS set VALUESTRING = '2004-04-28' where CONTEXT = 'SYSTEMINFO' and name = 'DBCreationDate';

alter table USERCATFAVORITES
   add constraint FK_USERCATFAVORITES foreign key (USERID)
      references USERS (USERID);

alter table USERDOCFAVORITES
   add constraint FK_USERDOCFAVORITES foreign key (USERID)
      references USERS (USERID);
      
commit;
