alter table projectmessages drop constraint FK_PROJECTMESSAGES;
drop table projectmessages;

/*==============================================================*/
/* Table: PROJECTMESSAGES                                       */
/*==============================================================*/
create table PROJECTMESSAGES (

MessageId            INTEGER                        not null,
ProjectId            INTEGER                        not null,
RecepientId          INTEGER                        not null,
MessageText          VARCHAR(2048)                  not null,
Link                 VARCHAR(1024),
Created              TIMESTAMP                      not null,
CreatorId            INTEGER,

constraint PK_PROJECTMESSAGES primary key (MessageId),
constraint FK_PROJECTMESSAGES foreign key (ProjectId) references PROJECTS (CATEGORYID) ON DELETE CASCADE
);

CREATE ASC INDEX index1_PROJECTMESSAGES ON PROJECTMESSAGES ProjectId;
CREATE ASC INDEX index2_PROJECTMESSAGES ON PROJECTMESSAGES RecepientId;

update SYSPARAMETERS set VALUESTRING = '70' where CONTEXT = 'SYSTEMINFO' and name = 'DBVersionLow';
update SYSPARAMETERS set VALUESTRING = '2004-04-02' where CONTEXT = 'SYSTEMINFO' and name = 'DBCreationDate';
commit;