MySQL Forums
Forum List  »  MySQL Workbench

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

Here is the execution in Command Line of the code.

'Groupes' and 'CodePostaux' tables are well created..

i also tried to execute CREATE INDEX after the Table
but i got the same error during the creation of 'Famille' table,
because of constraints part (if i skip constraint declarations
it works properly..)

any idea ?

Thanks !

mysql> CREATE TABLE IF NOT EXISTS `SuperGESTION`.`Groupes` (
-> `idGroupes` SMALLINT NOT NULL AUTO_INCREMENT ,
-> `Nom` VARCHAR(32) NULL DEFAULT 'NC' ,
-> PRIMARY KEY (`idGroupes`) )
-> ENGINE = InnoDB;
Query OK, 0 rows affected (0.11 sec)

mysql>
mysql>
mysql> 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;
Query OK, 0 rows affected (0.06 sec)

mysql>
mysql>
mysql> 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; SHOW WARNINGS;
ERROR 1005 (HY000): Can't create table 'supergestion.famille' (errno: 150)
+-------+------+--------------------------------------------------------+
| Level | Code | Message |
+-------+------+--------------------------------------------------------+
| Error | 1005 | Can't create table 'supergestion.famille' (errno: 150) |
+-------+------+--------------------------------------------------------+
1 row in set (0.00 sec)

Options: ReplyQuote


Subject
Views
Written By
Posted
9551
January 30, 2009 05:39AM
Re: Workbench export : constraints error
4103
January 30, 2009 11:02AM


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.