CREATE TABLE `newestchatmessage` (
	`Oid` BIGINT(19) NOT NULL AUTO_INCREMENT,
	`Tid` INT(10) DEFAULT NULL,
	`IsActive` TINYINT(1) DEFAULT NULL,
	`Notice` VARCHAR(1024) DEFAULT NULL,
	`InsTs` DATETIME DEFAULT NULL,
	`InsUser` VARCHAR(256) DEFAULT NULL,
	`Version` BIGINT(19) DEFAULT NULL,
	`UdpUser` VARCHAR(256) DEFAULT NULL,
	`SystemEntryID` INT(10) DEFAULT NULL,
	`RecipientPersonOid` BIGINT(19) DEFAULT NULL,
	`SenderPersonOid` BIGINT(19) DEFAULT NULL,
	`ChatMessageOid` BIGINT(19) DEFAULT NULL,
	`IsTeam` TINYINT(1) DEFAULT NULL,
	PRIMARY KEY (`Oid`),
	KEY `NEWESTCHATMESSAGE_RECIPIENT_FK` (`RecipientPersonOid`),
	CONSTRAINT `FK_NEWESTCHATMESSAGE_RECIPIENT` FOREIGN KEY (`RecipientPersonOid`) REFERENCES `Person` (`Oid`) ON DELETE NO ACTION ON UPDATE NO ACTION,
	
	KEY `NEWESTCHATMESSAGE_SENDER_FK` (`SenderPersonOid`),
	CONSTRAINT `FK_NEWESTCHATMESSAGE_SENDER` FOREIGN KEY (`SenderPersonOid`) REFERENCES `Person` (`Oid`) ON DELETE NO ACTION ON UPDATE NO ACTION,
	
	KEY `NEWESTCHATMESSAGE_CHATMESSAGE_FK` (`ChatMessageOid`),
	CONSTRAINT `FK_NEWESTCHATMESSAGE_CHATMESSAGE` FOREIGN KEY (`ChatMessageOid`) REFERENCES `ChatMessages` (`Oid`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB
AUTO_INCREMENT=1 CHARACTER SET 'latin1' COLLATE 'latin1_swedish_ci';