--
-- Table structure for table `message`
--
CREATE TABLE IF NOT EXISTS `message` (
`mID` int(10) unsigned NOT NULL auto_increment,
`toUserID` int(10) unsigned NOT NULL,
`fromUserID` int(10) unsigned NOT NULL,
`subject` varchar(255) NOT NULL,
`notification` int(11) NOT NULL default '0',
`draft` enum('0','1') NOT NULL default '0',
`archive` enum('0','1') NOT NULL default '0',
`created` datetime NOT NULL,
`opened` enum('0','1') NOT NULL default '0',
`rcptDel` enum('0','1') NOT NULL default '0',
`sndDel` enum('0','1') NOT NULL default '0',
PRIMARY KEY (`mID`),
KEY `FK_MSG_TO_USERID` (`toUserID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=122 ;
--
-- Table structure for table `message_content`
--
CREATE TABLE IF NOT EXISTS `message_content` (
`mtID` int(10) unsigned NOT NULL auto_increment,
`mID` int(10) unsigned NOT NULL,
`content` mediumtext NOT NULL,
PRIMARY KEY (`mtID`),
KEY `FK_MSG_MID` (`mID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
--
-- Constraints for table `message`
--
ALTER TABLE `message`
ADD CONSTRAINT `FK_MSG_TO_USERID` FOREIGN KEY (`toUserID`) REFERENCES `user` (`userID`) ON DELETE CASCADE ON UPDATE NO ACTION;
And the new table which i'm gonna create is:
CREATE TABLE `message` (
`msgID` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
`userIDs` VARCHAR(255) NOT NULL ,
`subject` VARCHAR(255) NOT NULL ,
`created` DATETIME NOT NULL ,
PRIMARY KEY (`msgID`) );
Bookmarks