(错误:150)错误驾驶我的坚果

时间:2017-06-13 13:52:15

标签: mysql

我可能在这里遗漏了一些东西,经过两周的尝试后我已经放弃了,任何人都可以看到一些令人眼花缭乱明显的原因,为什么这不会导入呢?

我试图查看我能想到的所有内容,但是当我尝试插入它时,我只收到150错误消息。

SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';

DROP TABLE IF EXISTS `classifieds_announcements`;
CREATE TABLE `classifieds_announcements` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `author` int(11) NOT NULL,
  `category` int(11) NOT NULL,
  `title` tinytext NOT NULL,
  `text` text NOT NULL,
  `date` int(11) NOT NULL COMMENT 'timestamp',
  `expire` int(11) NOT NULL COMMENT 'timestamp',
  `photo` varchar(255) NOT NULL,
  `approved` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `author` (`author`),
  KEY `category` (`category`),
  CONSTRAINT `classifieds_announcements_ibfk_1` FOREIGN KEY (`author`) REFERENCES `users` (`idu`) ON DELETE CASCADE,
  CONSTRAINT `classifieds_announcements_ibfk_2` FOREIGN KEY (`category`) REFERENCES `classifieds_categories` (`id`) ON DELETE CASCADE
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;


DROP TABLE IF EXISTS `classifieds_categories`;
CREATE TABLE `classifieds_categories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` tinytext NOT NULL,
  `parent` int(11) DEFAULT NULL,
  `allow_posting` int(11) DEFAULT '1' COMMENT 'may be 0 or 1 only if parent=0, else will be 1',
  `order` int(11) DEFAULT '50',
  PRIMARY KEY (`id`),
  KEY `parent` (`parent`),
  CONSTRAINT `classifieds_categories_ibfk_1` FOREIGN KEY (`parent`) REFERENCES `classifieds_categories` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


DROP TABLE IF EXISTS `classifieds_config`;
CREATE TABLE `classifieds_config` (
  `key` varchar(255) NOT NULL,
  `value` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `classifieds_config` (`key`, `value`) VALUES
('allow_emoticons', '1'),
('post_on_user_wall',   '1'),
('approve_new_posts',   '1'),
('index_columns',   '4'),
('time_between_announces',  '300'),
('time_between_reviews',    '90');

DROP TABLE IF EXISTS `classifieds_inputs`;
CREATE TABLE `classifieds_inputs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `category` int(11) NOT NULL,
  `name` text NOT NULL,
  `type` varchar(255) NOT NULL,
  `options` text,
  `required` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `category` (`category`),
  CONSTRAINT `classifieds_inputs_ibfk_1` FOREIGN KEY (`category`) REFERENCES `classifieds_categories` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


DROP TABLE IF EXISTS `classifieds_inputs_answers`;
CREATE TABLE `classifieds_inputs_answers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `input` int(11) NOT NULL,
  `announce` int(11) NOT NULL,
  `answer` text NOT NULL,
  PRIMARY KEY (`id`),
  KEY `input` (`input`),
  KEY `announce` (`announce`),
  CONSTRAINT `classifieds_inputs_answers_ibfk_1` FOREIGN KEY (`input`) REFERENCES `classifieds_inputs` (`id`) ON DELETE CASCADE,
  CONSTRAINT `classifieds_inputs_answers_ibfk_2` FOREIGN KEY (`input`) REFERENCES `classifieds_inputs` (`id`) ON DELETE CASCADE,
  CONSTRAINT `classifieds_inputs_answers_ibfk_3` FOREIGN KEY (`announce`) REFERENCES `classifieds_announcements` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


DROP TABLE IF EXISTS `classifieds_reports`;
CREATE TABLE `classifieds_reports` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `reported_by` int(11) NOT NULL,
  `reported_announce` int(11) NOT NULL,
  `read` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `reported_by` (`reported_by`),
  KEY `reported_announce` (`reported_announce`),
  CONSTRAINT `classifieds_reports_ibfk_1` FOREIGN KEY (`reported_by`) REFERENCES `users` (`idu`) ON DELETE CASCADE,
  CONSTRAINT `classifieds_reports_ibfk_2` FOREIGN KEY (`reported_announce`) REFERENCES `classifieds_announcements` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


DROP TABLE IF EXISTS `classifieds_reviews`;
CREATE TABLE `classifieds_reviews` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `announce` int(11) NOT NULL,
  `score` tinyint(4) NOT NULL,
  `user` int(11) NOT NULL,
  `text` text NOT NULL,
  PRIMARY KEY (`id`),
  KEY `announce` (`announce`),
  KEY `user` (`user`),
  CONSTRAINT `classifieds_reviews_ibfk_1` FOREIGN KEY (`announce`) REFERENCES `classifieds_announcements` (`id`) ON DELETE CASCADE,
  CONSTRAINT `classifieds_reviews_ibfk_2` FOREIGN KEY (`user`) REFERENCES `users` (`idu`) ON DELETE CASCADE,
  CONSTRAINT `classifieds_reviews_ibfk_3` FOREIGN KEY (`announce`) REFERENCES `classifieds_announcements` (`id`) ON DELETE CASCADE,
  CONSTRAINT `classifieds_reviews_ibfk_4` FOREIGN KEY (`user`) REFERENCES `users` (`idu`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

0 个答案:

没有答案