11-18-2012, 07:43 PM
Here is a small fix for you as far as the postoffice.
-- ----------------------------
-- Table structure for `postoffice`
-- ----------------------------
DROP TABLE IF EXISTS `postoffice`;
CREATE TABLE `postoffice` (
`recvdate` varchar(50) NOT NULL,
`sendcharacteridx` int(11) NOT NULL,
`msgcategory` smallint(6) NOT NULL DEFAULT '-1',
`msgtype` smallint(6) NOT NULL DEFAULT '-1',
`recvcharacteridx` int(11) NOT NULL DEFAULT '0',
`subject` varchar(41) DEFAULT '',
`contents` varchar(255) DEFAULT '',
`money` bigint(20) DEFAULT '0',
`billreqflag` smallint(6) DEFAULT '0',
`viewicon` int(11) NOT NULL DEFAULT '0',
`sendName` varchar(20) NOT NULL DEFAULT '',
`recvName` varchar(20) NOT NULL DEFAULT '',
PRIMARY KEY (`recvdate`,`sendcharacteridx`,`msgcategory`,`msgtype`),
KEY `msgcategorypostoffice` (`msgcategory`),
KEY `msgtypepostoffice` (`msgtype`),
KEY `sendcharacteridxpostoffice` (`sendcharacteridx`),
CONSTRAINT `postoffice_ibfk_1` FOREIGN KEY (`msgcategory`) REFERENCES `premiumtype` (`msgcategory`),
CONSTRAINT `postoffice_ibfk_2` FOREIGN KEY (`msgtype`) REFERENCES `msgtype` (`msgtype`),
CONSTRAINT `postoffice_ibfk_3` FOREIGN KEY (`sendcharacteridx`) REFERENCES `mailaccount` (`sendcharacteridx`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of postoffice
-- ----------------------------

