Closed marcelloh closed 8 years ago
Make sure the value put in user3_id exists as a primary key in your Users table. By default in Spot, you should be able to put null
instead of a primary key in user3_id if you don't want to set the relationship.
You might have an empty string instead of null
.
The NULL part did it for me :-) Thanks again
You should close the issue if your problem is solved.
unclear how to define a foreign key that also can be null
I now get a mysql error: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails probably because there has to be a matching id, which is not always the case.
And I can't seem to find the options in the docs that can be used to configure an entity-field Part of the entity:
'user3_id' => ['type' => 'integer','index' => true],
I found in Manager some settings, so I played with the notnull, but both give me the same error: