Změňte typ ze sloupce idParent
na int(10) unsigned
. Je to tedy stejný typ jako odkazovaný sloupec idBC
.
DROP TABLE IF EXISTS `biological classification`;
CREATE TABLE `biological classification` (
`idBC` int(10) unsigned NOT NULL AUTO_INCREMENT,
`idParent` int(10) unsigned DEFAULT NULL,
`type` varchar(45) DEFAULT NULL,
`value` varchar(45) DEFAULT NULL,
PRIMARY KEY (`idBC`),
UNIQUE KEY `idnew_table_UNIQUE` (`idBC`),
CONSTRAINT `SelfKey` FOREIGN KEY (`idParent`) REFERENCES `biological classification` (`idBC`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=latin1 COMMENT='A table that contains the Biological Classification of anima';