Closed mmethner closed 6 years ago
Reading the commit history (https://github.com/spotorm/spot2/commit/1a70172c3b247ce8792bb7e9456de0cab924f5b0) there seems to be foreignkey
setting with defaults to true
. Not sure if it is related. Seems 2.2.0 also broke Postgres migrations see #183.
Ok. Thanks for your hint.
You need to set 'foreignkey' => false
on every field, which is a reference to a foreign table.
That solution is not perfect, but it works.
Hi,
after upgrading from 2.17 to 2.2.0 my current project breaks. Looks, like the foreign key support causes an exception on existing data sets, while I call ->migrate() to update the scheme.
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (
booking_1.
#sql-61b8_2fa, CONSTRAINT
usr_bookings_fk_discountFOREIGN KEY (
discount_id) REFERENCES
usr_discounts(
id) ON DELETE SET NULL ON UPDATE CASCADE)
Is there a way to disable the foreign key support?
Best regards Mathias