By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
version() |
---|
8.0.30 |
Column 'product_id' cannot be NOT NULL: needed in a foreign key constraint 'fk.faq.product_id' SET NULL
Table | Create Table |
---|---|
faq | CREATE TABLE `faq` ( `id` binary(16) NOT NULL, `question` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `answer` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `product_id` binary(16) DEFAULT NULL, `created_at` datetime(3) NOT NULL, `updated_at` datetime(3) DEFAULT NULL, PRIMARY KEY (`id`), KEY `fk.faq.product_id` (`product_id`), CONSTRAINT `fk.faq.product_id` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci |