MySQL Forums
Forum List  »  MySQL Workbench

Unable to Forward Engineer with Workbench SE
Posted by: Bob Paris
Date: May 20, 2008 09:46AM

Can't create table '.\stocktracker\userstocks.frm' (errno: 150)
when forward engineering the following:
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 `stocktracker` DEFAULT CHARACTER SET latin1 ;
USE `stocktracker`;

-- -----------------------------------------------------
-- Table `stocktracker`.`stocks`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `stocktracker`.`stocks` (
`stocksid` INT UNSIGNED NOT NULL AUTO_INCREMENT ,
`symbol` VARCHAR(8) NULL DEFAULT NULL ,
`name` VARCHAR(45) NULL ,
PRIMARY KEY (`stocksid`) )
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;


-- -----------------------------------------------------
-- Table `stocktracker`.`users`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `stocktracker`.`users` (
`userID` INT UNSIGNED NOT NULL AUTO_INCREMENT ,
`loginid` VARCHAR(20) NULL DEFAULT NULL ,
`lastName` VARCHAR(30) NULL DEFAULT NULL ,
`firstName` VARCHAR(30) NULL DEFAULT NULL ,
`pswd` MEDIUMBLOB NOT NULL ,
`admin` BOOLEAN NOT NULL ,
PRIMARY KEY (`userID`) )
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;


-- -----------------------------------------------------
-- Table `stocktracker`.`userstocks`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `stocktracker`.`userstocks` (
`userID` INT UNSIGNED NOT NULL ,
`symbol` VARCHAR(8) NOT NULL ,
PRIMARY KEY (`userID`, `symbol`) ,
INDEX fk_userstocks_users (`userID` ASC) ,
INDEX fk_userstocks_stocks (`symbol` ASC) ,
CONSTRAINT `fk_userstocks_users`
FOREIGN KEY (`userID` )
REFERENCES `stocktracker`.`users` (`userID` )
ON DELETE CASCADE
ON UPDATE CASCADE,
CONSTRAINT `fk_userstocks_stocks`
FOREIGN KEY (`symbol` )
REFERENCES `stocktracker`.`stocks` (`symbol` )
ON DELETE CASCADE
ON UPDATE CASCADE)
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;



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



+--------------------------------------------+
| Catalog Diff Report |
+--------------------------------------------+
Table `stocktracker`.`stocks` was created
columns:
- stocksid of type INT
- symbol of type VARCHAR
- name of type VARCHAR
__
indices:
- PRIMARY with columns: stocksid
__
attributes:
- engine: InnoDB
- default character set: latin1
- default collate: latin1_swedish_ci
__
Table `stocktracker`.`users` was created
columns:
- userID of type INT
- loginid of type VARCHAR
- lastName of type VARCHAR
- firstName of type VARCHAR
- pswd of type MEDIUMBLOB
- admin of type BOOLEAN
__
indices:
- PRIMARY with columns: userID
__
attributes:
- engine: InnoDB
- default character set: latin1
- default collate: latin1_swedish_ci
__
Table `stocktracker`.`userstocks` was created
columns:
- userID of type INT
- symbol of type VARCHAR
__
indices:
- PRIMARY with columns: userID, symbol
- fk_userstocks_users with columns: userID
- fk_userstocks_stocks with columns: symbol
__
foreign keys:
- fk_userstocks_users with columns: userID, referred table: users with columns: userID
- action on update: CASCADE
- action on delete: CASCADE
- fk_userstocks_stocks with columns: symbol, referred table: stocks with columns: symbol
- action on update: CASCADE
- action on delete: CASCADE
__
attributes:
- engine: InnoDB
- default character set: latin1
- default collate: latin1_swedish_ci
__
----------------------------------------------
End of MySQL Workbench Report

Options: ReplyQuote


Subject
Views
Written By
Posted
Unable to Forward Engineer with Workbench SE
4350
May 20, 2008 09:46AM


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.