Cannot reference a table that references back to the first table
I am getting this typescript error
When I am trying to create a foreign key on one of the columns to a table that also has a foreign key constraint back the the
clubs
table, is this not allowed or is there a different way to do it?2 Replies
You need to cast it to a column to avoid the circular reference
An example can be found here: https://orm.drizzle.team/docs/indexes-constraints#foreign-key
Drizzle ORM - next gen TypeScript ORM
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.