Answer the question
In order to leave comments, you need to log in
Why is the foreign key not being added?
There are sl. tables:
payments: pastebin.com/KMZgKdNi
payment_statuses: pastebin.com/Lu7pbj0Q
payment_types: pastebin.com/Dhq2GgQR
The payments table is currently full, type_id field == 0 (tried to put 1 - no result), when executing the request:
ALTER TABLE `payments` ADD CONSTRAINT `payments_ibfk_3` FOREIGN KEY (`type_id`) REFERENCES `db_name`.`payment_types`(`id`) ON DELETE CASCADE ON UPDATE RESTRICT;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question