게시판 즐겨찾기
편집
드래그 앤 드롭으로
즐겨찾기 아이콘 위치 수정이 가능합니다.
MYSQL 스크립트 잘되는지좀 테스트 부탁드립니다
게시물ID : programmer_11390짧은주소 복사하기
작성자 : 라코누
추천 : 0
조회수 : 232회
댓글수 : 2개
등록시간 : 2015/06/18 13:42:58
sql 스크립트가 입력이 안되네요 
member_roles 생성할때 ERROR 1005 가 뜨는데요
다른 친구는 잘된다고 해서요
잘넣어지는 테스트좀 부탁드립니다!
-------------------------------------------------------------------------------


CREATE SCHEMA test;
USE test;

--
-- Table structure for table `tendency`
--

CREATE TABLE tendency (
  tendency_id varchar(10) NOT NULL,
  title varchar(45) DEFAULT NULL,
  PRIMARY KEY (tendency_id) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



--
-- Table structure for table `member`
--

CREATE TABLE member (
  member_id varchar(45) NOT NULL,
  password varchar(45) DEFAULT NULL,
  nickname varchar(45) DEFAULT NULL,
  email varchar(45) DEFAULT NULL,
  reg_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  method varchar(10) DEFAULT NULL,
  task varchar(10) DEFAULT NULL,
  exam varchar(10) DEFAULT NULL,
  email_auth tinyint(4) unsigned DEFAULT '1',
  type varchar(45) DEFAULT '1',
  enabled tinyint(4) unsigned DEFAULT '1',
  PRIMARY KEY (member_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


--
-- Table structure for table `member_roles`
--

CREATE TABLE member_roles (
  member_role_id INT(11) NOT NULL AUTO_INCREMENT,
  member_id VARCHAR(45) NOT NULL,
  ROLE VARCHAR(45) NOT NULL,
  PRIMARY KEY (member_role_id),
  UNIQUE KEY uni_member_id_role (ROLE,member_id),
  KEY fk_username_idx (member_id),
  CONSTRAINT fk_member_id FOREIGN KEY (member_id) REFERENCES member (member_id));


--
-- Table structure for table `lecture`
--

CREATE TABLE lecture (
  lecture_id int(10) unsigned NOT NULL AUTO_INCREMENT,
  lecture_name varchar(45) DEFAULT NULL,
  dept varchar(45) DEFAULT NULL,
  prof varchar(45) DEFAULT NULL,
  likes int(10) unsigned DEFAULT '1',
  PRIMARY KEY (lecture_id)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;




--
-- Table structure for table `evaluation`
--

CREATE TABLE evaluation (
  evaluation_id int(10) unsigned NOT NULL AUTO_INCREMENT,
  lecture_id int(10) unsigned DEFAULT NULL,
  member_id varchar(45) DEFAULT NULL,
  method varchar(45) DEFAULT NULL,
  task varchar(45) DEFAULT NULL,
  exam varchar(45) DEFAULT NULL,
  comment varchar(45) DEFAULT NULL,
  score int(10) unsigned DEFAULT NULL,
  write_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  is_delete tinyint(4) unsigned DEFAULT '1',
  is_reply tinyint(4) unsigned DEFAULT NULL,
  upper_id int(10) unsigned DEFAULT NULL,
  likes int(10) unsigned DEFAULT '0',
  dislike int(10) unsigned DEFAULT '0',
  report int(10) unsigned DEFAULT '0',
  PRIMARY KEY (evaluation_id),
  KEY FK_evaluation_lecture (lecture_id),
  KEY FK_evaluation_member (member_id),
  CONSTRAINT FK_evaluation_member FOREIGN KEY (member_id) REFERENCES member (member_id) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT FK_evaluation_lecture FOREIGN KEY (lecture_id) REFERENCES lecture (lecture_id) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

전체 추천리스트 보기
새로운 댓글이 없습니다.
새로운 댓글 확인하기
글쓰기
◀뒤로가기
PC버전
맨위로▲
공지 운영 자료창고 청소년보호