-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Hello,
I am using loopback 4 for my server side. I built my models with the new inclusion functionality.
I have model A and model B, In model A, there is a foreign key of model B. When I make a get request, I get the information with the whole object of the foreign key. Everything works perfectly but ... my foreign key is not required. So, when I make a get request in case the foreign key is null, I get the following error:
DEFAULT is not allowed in this context on Connection.parseE ...
This problem only exists if in the database there are rows where the fk is null and another where the fk is not null.
For example:
id: 1,
name: "aaaa",
modelb_id: null
id: 2,
name: "bbb",
modelb_id: 1
I mean if in all the rows the fk is null, everything works perfectly.
Anyone knows a solution ???
Thank you