Leser: 16
1
2
3
ALTER TABLE market ADD FOREIGN KEY (buyer_id, seller_id) REFERENCES
accounts (id) ON DELETE SET NULL ON UPDATE CASCADE;
[b]Fehlermeldung:[/b] ERROR 1005 (HY000): Can't create table './d00e434e/#sql-13d9_4309ea.frm' (errno: 150)
1
2
3
4
5
6
ALTER TABLE market_transactions ADD FOREIGN KEY (seller_id) REFERENCES
accounts (id) ON DELETE SET NULL ON UPDATE CASCADE;
[b]Fehlermeldung:[/b]ERROR 1452 (23000):
Cannot add or update a child row: a foreign key constraint
fails (`d00e434e/#sql-13d9_4309ea`, CONSTRAINT `#sql-13d9_4309ea_ibfk_1`
FOREIGN KEY (`seller_id`) REFERENCES `accounts` (`id`) ON DELETE SET NULL ON UPDATE CASCADE)
1
2
3
4
5
ALTER TABLE market_transactions ADD FOREIGN KEY (buyer_id) REFERENCES
accounts (id) ON DELETE SET NULL ON UPDATE CASCADE;
Query OK, 128 rows affected (0.09 sec)
Records: 128 Duplicates: 0 Warnings: 0