$ perror 150 MySQL error code 150: Foreign key constraint is incorrectly formed Opravte svůj FOREIGN KEY definice.