update SYSPARAMETERS set VALUESTRING = '1'  where CONTEXT = 'SYSTEMINFO' and name = 'DBVersionHigh';
update SYSPARAMETERS set VALUESTRING = '106' where CONTEXT = 'SYSTEMINFO' and name = 'DBVersionLow';
update SYSPARAMETERS set VALUESTRING = '2004-08-13' where CONTEXT = 'SYSTEMINFO' and name = 'DBCreationDate';

/* USERREGISTEREDSEARCHQUERIES */
create table USERREGISTEREDSEARCHQUERIES (
URSQID	             INTEGER                        not null,
QUERYID              INTEGER                        not null,
USERID               INTEGER                        not null,
QUERYFIELD           VARCHAR(512),

constraint PK_USERREGISTEREDSEARCHQUERIES primary key ( URSQID )
);

alter table USERREGISTEREDSEARCHQUERIES
   add constraint FK_USERS4 foreign key (USERID)
      references USERS (USERID);
      
create generator USERREGISTEREDSEARCHQUERIES_SEQ;
set generator USERREGISTEREDSEARCHQUERIES_SEQ to 0;

/* add queryid to userdocmails*/
alter table USERDOCMAILS
    add QUERYID INTEGER;
    
/* Additional Sysparam: notification period*/
insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (57, 'MAIL', 'sysparam.context.mail', 'NotificationCheckPeriod', 'sysparam.context.mail.notificationcheckperiod', '10', 'Period of minutes to check for notifications', 'sysparam.context.mail.notificationcheckperiod.descr', 0, 0, 0, 1);

commit;