Hey there folks,
I currently have a situation where I want a record in one table to point to another row in the same table. In other words this table must have a foreign key that points to its own primary key.
For example, we have a table called Units - a unit being a collection of lessons. We want a unit to have two new fields called priorStudyUnit
and futureStudyUnit
which point to other units in the collection.
I’ve tried various ways of getting working but nothing seems to be working at the moment.
I’m currently trying the following:
Expected behavior
When I update a unit in the UI I should be able to alter the futureStudyUnit / priorStudyUnit
field so it links to another unit record.
Actual behavior
Getting errors at the moment when I attempt to do this.
I can see the error is resulting because the request above is being made in the background and responding with 404.
Context
Please provide any relevant information about your setup.
- Package Version:
- Express Version:
- Sequelize Version:
- Database Dialect: postgres
- Database Version:
- Project Name: