I was trying to add a many-to-many relationship through a join table on a somewhat more complex set of models, so I tried dumbing it down when it wouldn't work into something with just two properties, and still can't get it to work.
Documentation I was attempting to follow for many-to-many from Hasura: https://hasura.io/docs/latest/graphql/core/guides/data-modelling/many-to-many.html#step-1-set-up-a-table-relationship-in-the-database
Say I want to have a relationship as follows:
- Many Cars which can have many drivers
- Many drivers whom can drive many cars
I created a car table
which has:
id
- Unique Integer, primary keyname
- text
I created the driver
table which has:
id
- Unique Integer, primary keytype
- text
I created the car_user
table which has:
car_id
- Integer, primary keydriver_id
- Integer, primary keyid
- Unique Integer (have tried with and without this)
Whenever I attempt to go and then add the foreign keys for the car_id and/or driver_id. I get an error as follows and have absolutely no idea how to solve it.