错误105 mysql FOREIGN KEYS

时间:2015-05-16 08:10:40

标签: mysql foreign-keys

我正在尝试创建数据库表并通过mysql FOREIGN KEYS连接它们。我确保我的数据类型完全相同。我还确保在添加FK之前制作我的表格。任何建议都将不胜感激。

SELECT * FROM categories ORDER BY `order` DESC
MySQL说:

1005 - 无法创建表格' estafeed_rss.af_feeds' (错误:150)(详情......)

enter image description here

CREATE TABLE IF NOT EXISTS `af_feeds` (
  `id` int(64) unsigned NOT NULL AUTO_INCREMENT,
  `hash` char(255) NOT NULL,
  `seed_id` int(64) NOT NULL,
  `category_id` int(64) NOT NULL,
  `title` varchar(255) NOT NULL,
  `description` text,
  `content` longtext,
  `publishing_date` varchar(255) NOT NULL,
  `link` text NOT NULL,
  `status` int(1) NOT NULL,
  `create_date` int(64) NOT NULL,
  `update_date` int(64) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `hash` (`hash`),
  FOREIGN KEY (`seed_id`) REFERENCES `af_seeds`(`id`)
  ON UPDATE CASCADE
  ON DELETE CASCADE,
  FOREIGN KEY (`category_id`) REFERENCES `af_categories`(`id`)
  ON UPDATE CASCADE
  ON DELETE CASCADE

0 个答案:

没有答案