Skip navigation links

MySQL Forums :: InnoDB :: Error 1005: Can't create table ... (errno: 150)


Advanced Search

Error 1005: Can't create table ... (errno: 150)
Posted by: T W ()
Date: May 17, 2009 12:15PM

Script line: 30 Can't create table '.\thomtrack\projects.frm' (errno: 150)
I can't figure out what the error is. Creating tables is not my best skill, so I always use tools.
The Code was generated by workbench.
MySQL version: 5.0.67-community-nt
Any help will be appreciated
Line 30 is this one:
CREATE TABLE IF NOT EXISTS `Thomtrack`.`projects` (


---SQL FILE ---

SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';

CREATE SCHEMA IF NOT EXISTS `Thomtrack` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin ;
USE `Thomtrack`;

-- -----------------------------------------------------
-- Table `Thomtrack`.`credentials`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `Thomtrack`.`credentials` ;

CREATE TABLE IF NOT EXISTS `Thomtrack`.`credentials` (
`credentials_uid` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT 'id' ,
`credentials_un` VARCHAR(20) CHARACTER SET 'utf8' COLLATE 'utf8_bin' NOT NULL COMMENT 'username' ,
`credentials_pw` CHAR(32) CHARACTER SET 'utf8' COLLATE 'utf8_bin' NOT NULL COMMENT 'password' ,
`credentials_active` BOOLEAN NOT NULL DEFAULT 0 ,
`credentials_isadmin` BOOLEAN NULL ,
PRIMARY KEY (`credentials_uid`) ,
UNIQUE INDEX `credentials_un` (`credentials_un` ASC) )
ENGINE = InnoDB
AUTO_INCREMENT = 1;


-- -----------------------------------------------------
-- Table `Thomtrack`.`projects`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `Thomtrack`.`projects` ;

CREATE TABLE IF NOT EXISTS `Thomtrack`.`projects` (
`project_id` BIGINT(20) NOT NULL AUTO_INCREMENT ,
`project_name` VARCHAR(25) CHARACTER SET 'utf8' COLLATE 'utf8_bin' NOT NULL COMMENT 'project naam' ,
`project_owner_uid` BIGINT(20) NOT NULL COMMENT 'foreign key van credentials_uid' ,
`project_description` TEXT CHARACTER SET 'utf8' COLLATE 'utf8_bin' NOT NULL COMMENT 'beschrijving' ,
PRIMARY KEY (`project_id`) ,
INDEX `fk_credentials_uid` (`project_owner_uid` ASC) ,
CONSTRAINT `fk_credentials_uid`
FOREIGN KEY (`project_owner_uid` )
REFERENCES `Thomtrack`.`credentials` (`credentials_uid` )
ON DELETE SET NULL
ON UPDATE NO ACTION)
ENGINE = InnoDB
AUTO_INCREMENT = 1
COMMENT = 'relatie van project_owner_id met credentials_uid';


-- -----------------------------------------------------
-- Table `Thomtrack`.`tickets`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `Thomtrack`.`tickets` ;

CREATE TABLE IF NOT EXISTS `Thomtrack`.`tickets` (
`ticket_id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT 'ID' ,
`ticket_name` VARCHAR(25) CHARACTER SET 'utf8' COLLATE 'utf8_bin' NOT NULL COMMENT 'naam van de ticket' ,
`ticket_description` TEXT CHARACTER SET 'utf8' COLLATE 'utf8_bin' NOT NULL COMMENT 'beschrijving' ,
`ticket_reporter_uid` BIGINT(20) NOT NULL COMMENT 'foreign key van credentials_uid' ,
`ticket_timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP COMMENT 'tijdstip van comment' ,
`project_id` BIGINT(20) NOT NULL ,
`ticket_status` TINYINT NULL ,
`ticket_assigned_uid` BIGINT(20) NULL ,
`ticket_milestone` BIGINT(20) NULL ,
`ticket_priority` TINYINT NULL DEFAULT 0 ,
`ticket_due` DATE NULL ,
PRIMARY KEY (`ticket_id`) ,
INDEX `ticket_sender_uid` (`ticket_reporter_uid` ASC) ,
INDEX `fk_tickets_projects` (`project_id` ASC) ,
INDEX `fk_ticket_reporter_uid` (`ticket_reporter_uid` ASC) ,
INDEX `fk_ticket_assigned_id` (`ticket_assigned_uid` ASC) ,
CONSTRAINT `fk_tickets_projects`
FOREIGN KEY (`project_id` )
REFERENCES `Thomtrack`.`projects` (`project_id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_ticket_reporter_uid`
FOREIGN KEY (`ticket_reporter_uid` )
REFERENCES `Thomtrack`.`credentials` (`credentials_uid` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_ticket_assigned_id`
FOREIGN KEY (`ticket_assigned_uid` )
REFERENCES `Thomtrack`.`credentials` (`credentials_uid` )
ON DELETE SET NULL
ON UPDATE NO ACTION)
ENGINE = InnoDB
AUTO_INCREMENT = 1;


-- -----------------------------------------------------
-- Table `Thomtrack`.`contactinfo`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `Thomtrack`.`contactinfo` ;

CREATE TABLE IF NOT EXISTS `Thomtrack`.`contactinfo` (
`contactinfo_id` BIGINT(20) NOT NULL AUTO_INCREMENT ,
`credentials_uid` BIGINT(20) NOT NULL ,
`contactinfo_email` VARCHAR(80) NOT NULL ,
`contactinfo_created` TIMESTAMP NULL ,
PRIMARY KEY (`contactinfo_id`) ,
INDEX `fk_credentials_uid` (`credentials_uid` ASC) ,
CONSTRAINT `fk_credentials_uid`
FOREIGN KEY (`credentials_uid` )
REFERENCES `Thomtrack`.`credentials` (`credentials_uid` )
ON DELETE CASCADE
ON UPDATE NO ACTION)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `Thomtrack`.`messages`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `Thomtrack`.`messages` ;

CREATE TABLE IF NOT EXISTS `Thomtrack`.`messages` (
`message_id` BIGINT(20) NOT NULL AUTO_INCREMENT ,
`message_from_uid` BIGINT(20) NOT NULL ,
`message_to_uid` BIGINT(20) NOT NULL ,
`message_subject` VARCHAR(80) NOT NULL ,
`message_body` TEXT NOT NULL ,
PRIMARY KEY (`message_id`) ,
INDEX `fk_message_from_uid` (`message_from_uid` ASC) ,
INDEX `fk_message_to_uid` (`message_to_uid` ASC) ,
CONSTRAINT `fk_message_from_uid`
FOREIGN KEY (`message_from_uid` )
REFERENCES `Thomtrack`.`credentials` (`credentials_uid` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_message_to_uid`
FOREIGN KEY (`message_to_uid` )
REFERENCES `Thomtrack`.`credentials` (`credentials_uid` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `Thomtrack`.`ticketcomments`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `Thomtrack`.`ticketcomments` ;

CREATE TABLE IF NOT EXISTS `Thomtrack`.`ticketcomments` (
`ticketcomment_id` BIGINT(20) NOT NULL AUTO_INCREMENT ,
`ticket_id` BIGINT(20) NOT NULL ,
`ticketcomment_subject` VARCHAR(45) NOT NULL ,
`ticketcomment_body` TEXT NOT NULL ,
`ticketcomment_by_uid` BIGINT(20) NOT NULL ,
`ticketcomment_timestamp` TIMESTAMP NOT NULL ,
PRIMARY KEY (`ticketcomment_id`) ,
INDEX `fk_ticket_id` (`ticket_id` ASC) ,
INDEX `fk_ticketcomment_by_uid` (`ticketcomment_by_uid` ASC) ,
CONSTRAINT `fk_ticket_id`
FOREIGN KEY (`ticket_id` )
REFERENCES `Thomtrack`.`tickets` (`ticket_id` )
ON DELETE CASCADE
ON UPDATE NO ACTION,
CONSTRAINT `fk_ticketcomment_by_uid`
FOREIGN KEY (`ticketcomment_by_uid` )
REFERENCES `Thomtrack`.`credentials` (`credentials_uid` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `Thomtrack`.`projectmembers`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `Thomtrack`.`projectmembers` ;

CREATE TABLE IF NOT EXISTS `Thomtrack`.`projectmembers` (
`projectmember_id` BIGINT(20) NOT NULL AUTO_INCREMENT ,
`project_id` BIGINT(20) NOT NULL ,
`projectmember_uid` BIGINT(20) NOT NULL ,
`projectmember_priviligelevel` TINYINT NULL DEFAULT 0 ,
PRIMARY KEY (`projectmember_id`) ,
INDEX `fk_projectmembers_project` (`project_id` ASC) ,
INDEX `fk_projectmembers_members` (`projectmember_uid` ASC) ,
CONSTRAINT `fk_projectmembers_project`
FOREIGN KEY (`project_id` )
REFERENCES `Thomtrack`.`projects` (`project_id` )
ON DELETE CASCADE
ON UPDATE NO ACTION,
CONSTRAINT `fk_projectmembers_members`
FOREIGN KEY (`projectmember_uid` )
REFERENCES `Thomtrack`.`credentials` (`credentials_uid` )
ON DELETE CASCADE
ON UPDATE NO ACTION)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `Thomtrack`.`milestones`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `Thomtrack`.`milestones` ;

CREATE TABLE IF NOT EXISTS `Thomtrack`.`milestones` (
`milestone_id` BIGINT(20) NOT NULL AUTO_INCREMENT ,
`milestone_name` VARCHAR(45) NOT NULL ,
`project_id` BIGINT(20) NOT NULL ,
`milestone_desc` TEXT NOT NULL ,
`milestone_assigned_uid` BIGINT(20) NULL ,
PRIMARY KEY (`milestone_id`) ,
INDEX `fk_milestone_project_id` (`project_id` ASC) ,
INDEX `fk_milestone_assigned_uid` (`milestone_assigned_uid` ASC) ,
CONSTRAINT `fk_milestone_project_id`
FOREIGN KEY (`project_id` )
REFERENCES `Thomtrack`.`projects` (`project_id` )
ON DELETE CASCADE
ON UPDATE NO ACTION,
CONSTRAINT `fk_milestone_assigned_uid`
FOREIGN KEY (`milestone_assigned_uid` )
REFERENCES `Thomtrack`.`projectmembers` (`projectmember_uid` )
ON DELETE SET NULL
ON UPDATE NO ACTION)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `Thomtrack`.`projectinvites`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `Thomtrack`.`projectinvites` ;

CREATE TABLE IF NOT EXISTS `Thomtrack`.`projectinvites` (
`projectinvite_id` BIGINT(20) NOT NULL AUTO_INCREMENT ,
`project_id` BIGINT(20) NOT NULL ,
`projectinvite_uid` BIGINT(20) NOT NULL ,
PRIMARY KEY (`projectinvite_id`) ,
INDEX `fk_project_id` (`project_id` ASC) ,
INDEX `fk_project_uid` (`projectinvite_uid` ASC) ,
CONSTRAINT `fk_project_id`
FOREIGN KEY (`project_id` )
REFERENCES `Thomtrack`.`projects` (`project_id` )
ON DELETE CASCADE
ON UPDATE NO ACTION,
CONSTRAINT `fk_project_uid`
FOREIGN KEY (`projectinvite_uid` )
REFERENCES `Thomtrack`.`credentials` (`credentials_uid` )
ON DELETE CASCADE
ON UPDATE NO ACTION)
ENGINE = InnoDB;



SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;

Options: ReplyQuote


Subject Views Written By Posted
Error 1005: Can't create table ... (errno: 150) 3317 T W 05/17/2009 12:15PM
Solved: Error 1005: Can't create table ... (errno: 150) 1914 T W 05/18/2009 08:05AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.