MySQL Forums
Forum List  »  MySQL Workbench

Re: Workbench export : constraints error
Posted by: Thomas BOHL
Date: January 30, 2009 11:27AM

Sure, i used it, sorry i didn't write the complet instruction,
here it is, with the same error.

the code (down there) returns

ERROR 1005 (HY000): Can't create table 'supergestion.famille' (errno: 150)



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 `SuperGESTION` ;
SHOW WARNINGS;
USE `SuperGESTION`;


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

SHOW WARNINGS;


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;

SHOW WARNINGS;


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 ,
`Email` VARCHAR(45) NULL ,
`QF` SMALLINT UNSIGNED NULL ,
`CCAS` TINYINT UNSIGNED NULL DEFAULT 0 ,
`FAS` TINYINT UNSIGNED NULL DEFAULT 0 ,
`BV` TINYINT UNSIGNED NULL DEFAULT 0 ,
`DateCotisation` DATE 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;

SHOW WARNINGS;

Options: ReplyQuote


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


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.