I have a table:
CREATE TABLE `styles` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`designs_id` bigint unsigned DEFAULT NULL,
`departments_id` bigint unsigned NOT NULL,
`seasons_id` bigint unsigned NOT NULL,
`customers_id` bigint unsigned NOT NULL,
`customer_ref` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`commodity_codes_id` bigint unsigned DEFAULT NULL,
`notes` text COLLATE utf8mb4_unicode_ci,
`last_updated_by` bigint unsigned DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`use_version` bigint unsigned DEFAULT NULL,
`carryover` tinyint(1) DEFAULT NULL,
`category` enum('mens','ladies','accessories','childrens') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`cancelled` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_style_within_seasons_customer_etc` (`designs_id`,`departments_id`,`seasons_id`,`customers_id`,`category`),
KEY `styles_departments_id_foreign` (`departments_id`),
KEY `styles_seasons_id_foreign` (`seasons_id`),
KEY `styles_customers_id_foreign` (`customers_id`),
KEY `styles_commodity_codes_id_foreign` (`commodity_codes_id`),
KEY `styles_last_updated_by_foreign` (`last_updated_by`),
KEY `styles_use_version_foreign` (`use_version`),
CONSTRAINT `styles_commodity_codes_id_foreign` FOREIGN KEY (`commodity_codes_id`) REFERENCES `commodity_codes` (`id`) ON DELETE RESTRICT,
CONSTRAINT `styles_customers_id_foreign` FOREIGN KEY (`customers_id`) REFERENCES `customers` (`id`),
CONSTRAINT `styles_departments_id_foreign` FOREIGN KEY (`departments_id`) REFERENCES `departments` (`id`) ON DELETE CASCADE,
CONSTRAINT `styles_designs_id_foreign` FOREIGN KEY (`designs_id`) REFERENCES `designs` (`id`) ON DELETE CASCADE,
CONSTRAINT `styles_last_updated_by_foreign` FOREIGN KEY (`last_updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
CONSTRAINT `styles_seasons_id_foreign` FOREIGN KEY (`seasons_id`) REFERENCES `seasons` (`id`) ON DELETE CASCADE,
CONSTRAINT `styles_use_version_foreign` FOREIGN KEY (`use_version`) REFERENCES `style_versions` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=600 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
I want to remove the UNIQUE KEY unique_style_within_seasons_customer_etc
so that I can add another column to it, but when I do it says:
SQLSTATE[HY000]: General error: 1553 Cannot drop index 'unique_style_within_seasons_customer_etc': needed in a foreign key constraint (SQL: ALTER TABLE styles DROP INDEX unique_style_within_seasons_customer_etc)
Any ideas on what I've got wrong?