MySQL Forums
Forum List  »  MySQL Workbench

Workbench export : constraints error
Posted by: Thomas BOHL
Date: January 30, 2009 05:39AM

Hello !

I try to run this code created with a MySQL Workbench export

CREATE TABLE IF NOT EXISTS `SuperGESTION`.`Groupes` (
`idGroupes` SMALLINT NOT NULL AUTO_INCREMENT ,
`Nom` VARCHAR(32) NULL DEFAULT 'NC' ,
PRIMARY KEY (`idGroupes`) )
ENGINE = InnoDB;


CREATE TABLE IF NOT EXISTS `SuperGESTION`.`CodePostaux` (
`idCP` MEDIUMINT UNSIGNED NOT NULL ,
`Ville` VARCHAR(32) NULL ,
`Ext` TINYINT UNSIGNED NULL DEFAULT 1 ,
PRIMARY KEY (`idCP`) )
ENGINE = InnoDB;


CREATE TABLE IF NOT EXISTS `SuperGESTION`.`Famille` (
`idFamille` MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT ,
`idGroupes` SMALLINT NULL ,
`Adresse` VARCHAR(45) NULL DEFAULT 'NC' ,
`idCP` TINYINT UNSIGNED NULL ,
PRIMARY KEY (`idFamille`) ,
INDEX `GroupesLink` (`idGroupes` ASC) ,
INDEX `CPLink` (`idCP` ASC) ,
CONSTRAINT `GroupesLink`
FOREIGN KEY (`idGroupes` )
REFERENCES `SuperGESTION`.`Groupes` (`idGroupes` )
ON DELETE SET NULL
ON UPDATE CASCADE,
CONSTRAINT `CPLink`
FOREIGN KEY (`idCP` )
REFERENCES `SuperGESTION`.`CodePostaux` (`idCP` )
ON DELETE SET NULL
ON UPDATE CASCADE)
ENGINE = InnoDB;


but when i execute it, i got a ERRNO 150 because of the CONSTRAINT part
of the code (if i just delete all the Constraint part, the code runs ok)
if you got any ideas (Exporting parameters on Workbench, or Importing params in MySQL) it would be great !

MySQL Workbench OSS 5.0.29 Community
MySQL Server : 5.1.30-community

Thanks a lot

Thomas

Options: ReplyQuote


Subject
Views
Written By
Posted
Workbench export : constraints error
9550
January 30, 2009 05:39AM


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.