MySQL. Будто не видит таблицу
При создании FK будто не видит таблицу employess, но если делать FK в таблце employess, то все работает исправно, что может быть не так?
CREATE TABLE `employees` (
`personal_number` int NOT NULL,
`full_name` varchar(100) DEFAULT NULL,
`commission_rate` decimal(5,2) DEFAULT '3.00',
`post` enum('директор','консультант','молодший продавець','старший продавець','закупник') DEFAULT NULL,
`hire_date` date DEFAULT (curdate()),
PRIMARY KEY (`personal_number`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
CREATE TABLE `order` (
`id_order` int NOT NULL,
`id_book` int DEFAULT NULL,
`id_customer` int DEFAULT NULL,
`paid` enum('Так','Ні') DEFAULT NULL,
`date_order` date DEFAULT NULL,
PRIMARY KEY (`id_order`),
KEY `id_book_idx` (`id_book`),
KEY `id_customer_idx` (`id_customer`),
CONSTRAINT `id_book1` FOREIGN KEY (`id_book`) REFERENCES `book` (`id_book`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `id_customer` FOREIGN KEY (`id_customer`) REFERENCES `customer` (`id_customer`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
CREATE TABLE `delivery` (
`id_delivery` int NOT NULL,
`id_book` int DEFAULT NULL,
`id_provider` int DEFAULT NULL,
`quantity` int DEFAULT NULL,
`date_delivery` date DEFAULT NULL,
PRIMARY KEY (`id_delivery`),
KEY `id_book_idx` (`id_book`),
KEY `id_provider_idx` (`id_provider`),
CONSTRAINT `id_book` FOREIGN KEY (`id_book`) REFERENCES `book` (`id_book`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `id_provider` FOREIGN KEY (`id_provider`) REFERENCES `provider` (`id_provider`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
CREATE TABLE `provider` (
`id_provider` int NOT NULL,
`name_provider` varchar(45) DEFAULT NULL,
`city` varchar(45) DEFAULT NULL,
`address_provider` varchar(80) DEFAULT NULL,
`phone_provider` char(13) DEFAULT NULL,
PRIMARY KEY (`id_provider`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
CREATE TABLE `book` (
`id_book` int NOT NULL,
`author` varchar(80) DEFAULT NULL,
`name_book` varchar(160) DEFAULT NULL,
`publishing_office` varchar(100) DEFAULT NULL,
`price` double DEFAULT NULL,
`balance` smallint DEFAULT NULL,
PRIMARY KEY (`id_book`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
CREATE TABLE `customer` (
`id_customer` int NOT NULL,
`name_customer` varchar(45) DEFAULT NULL,
`address_customer` varchar(80) DEFAULT NULL,
`phone_customer` char(13) DEFAULT NULL,
PRIMARY KEY (`id_customer`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci