php-crud-api icon indicating copy to clipboard operation
php-crud-api copied to clipboard

Support foreign key that points to a non-primary (unique) key

Open nik2208 opened this issue 3 years ago • 3 comments

I have a questions table and an answers table. the answers table has a foreignKey field named questionUuid related to the field uuid (not related to the id field) of the question table. According to the docs, I supposed the join request would have been records/questions?join=answers but it actually doesn't work. Am I missing something?

If I filter the answers table per questionUuid, it applies correctly and I get only the answers related to their question.

nik2208 avatar Jan 09 '22 16:01 nik2208

So, you have a foreign key that points to a non-primary key, am I correct? I never took that situation into account.

mevdschee avatar Jan 10 '22 11:01 mevdschee

Exactly.. since nosql databases use uuid as a standard, I'm setting things up to make it support (eventually) hybridisation with ease.

nik2208 avatar Jan 10 '22 12:01 nik2208

now that I practiced with simple things, show me the path to work this out ;)

nik2208 avatar Feb 17 '22 10:02 nik2208