SQL的语句:
DROP TABLE IF EXISTS `person`;
CREATE TABLE `person` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(34) DEFAULT NULL,
  `password` varchar(34) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `massage1`;
CREATE TABLE `massage1` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `setdate` datetime DEFAULT NULL,
  `context` varchar(255) DEFAULT NULL,
  `setperons_id` int(11) DEFAULT NULL,
 
  PRIMARY KEY (`id`),
 
  KEY `setperons_id` (`setperons_id`),
 CONSTRAINT `setperons_id` FOREIGN KEY (`setperons_id`) REFERENCES `person` (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
在用逆向工程中无法达到要求。
要改为:

DROP TABLE IF EXISTS `person`;
CREATE TABLE `person` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(34) DEFAULT NULL,
  `password` varchar(34) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


DROP TABLE IF EXISTS `massage1`;
CREATE TABLE `massage1` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `setdate` datetime DEFAULT NULL,
  `context` varchar(255) DEFAULT NULL,
  `setperons_id` int(11) DEFAULT NULL,
 
  PRIMARY KEY (`id`),
 
  KEY `setperons_id` (`setperons_id`),
 CONSTRAINT `setperons_id` FOREIGN KEY (`setperons_id`) REFERENCES `person` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;