I made an ERD with MySQL Workbench and now I'm trying to import it,
The first table it tries to create it errors.
The sql:
CREATE TABLE IF NOT EXISTS `db`.`catagories` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(45) NULL,
`catagory` INT UNSIGNED NULL,
`order` INT NULL,
PRIMARY KEY (`id`),
INDEX `fk_catagory_idx` (`catagory` ASC),
CONSTRAINT `fk_catagory`
FOREIGN KEY (`catagory`)
REFERENCES `db`.`catagories` (`catagory`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
1005 - Can't create table 'db.catagories' (errno: 150)
both catagory and ID have an index, are the same, but it still throws this error, any thoughts?