/*==============================================================*/
/* Table: Änderungen an Constraints der Favoritentabellen       */
/*==============================================================*/
update SYSPARAMETERS set VALUESTRING = '1'  where CONTEXT = 'SYSTEMINFO' and name = 'DBVersionHigh';
update SYSPARAMETERS set VALUESTRING = '89' where CONTEXT = 'SYSTEMINFO' and name = 'DBVersionLow';
update SYSPARAMETERS set VALUESTRING = '2004-05-04' where CONTEXT = 'SYSTEMINFO' and name = 'DBCreationDate';

alter table USERDOCFAVORITES
   drop constraint FK_USERDOCFAVORITES;
   
alter table USERCATFAVORITES
   drop constraint FK_USERCATFAVORITES;

alter table USERCATFAVORITES
   add constraint FK_USERCATFAVORITES1 foreign key (CATEGORYID)
      references CATEGORIES (CATEGORYID);

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

alter table USERDOCFAVORITES
   add constraint FK_USERDOCFAVORITES1 foreign key (DOCUMENTID)
      references DOCUMENTS (DOCUMENTID);

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

commit;
