There are two tables, items and format_file .
items :
format_file :
I make connections between items.id_format_file and format_file.id .
But when I add two records with the same file format, this error pops up, I work in HeidiSQL .
Result SHOW CREATE TABLE items
CREATE TABLE `items` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `name` char(255) NOT NULL, `link` text NOT NULL, `owner` char(255) DEFAULT NULL, `date_start` date DEFAULT NULL, `date_end` date DEFAULT NULL, `description` mediumtext, `id_format_file` bigint(20) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `id_format_file` (`id_format_file`), CONSTRAINT `FK_items_format_file` FOREIGN KEY (`id_format_file`) REFERENCES `format_file` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 



UNIQUE KEY id_format_filefield value should be unique - Alexey Shimansky