When a foreign key is added, I’m unable to load the data anymore.
Expected behavior
I expect the panel to work properly.
Failure Logs
Pop up saying “Fetch record failed: Your data seems to be invalid: Expected 1 values, found 2”
How to Reproduce / Recent Changes
Before
table A - cols (id, x, y, xy)
pkey (x, y)
unique constraint (xy)
table B - cols (id, xy)
fkey to table A on col xy
Then, I deleted table A pkey, table A unique key, and table B fkey on table A and re-added table A pkey. (no problems loading here) and re-added table B fkey on table A (at this point I start getting problems).
Can you share the network call that leads to the error ?
In the new structure of the DB, is there still the unique contraint on “xy” ?
The error seems to indicate that somehow, forest or your DB still have references to the 2 deleted columns (“found 2”). If it’s not your DB, “sync database schema” in forest should solve the issue. It should be done everytime you change something in the DB structure.
Can you share the network call that leads to the error ?
I get it when I try to access a specific record in table A and the fkey link when I check table B seems to be missing (makes me think of Missing related data ) it’s the same tables as before.
In the new structure of the DB, there is just the primary key on “xy” (which verifies uniqueness).
There were no columns deleted on our end, just the change in the foreign key. I can assure you I re-sync the database when I change the DB, and often when I try to troubleshoot errors like this.