Cannot reference a table that references back to the first table

I am getting this typescript error
'clubs' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
'clubs' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
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
Angelelz
Angelelz12mo ago
You need to cast it to a column to avoid the circular reference
Angelelz
Angelelz12mo ago
Drizzle ORM - next gen TypeScript ORM
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
Want results from more Discord servers?
Add your server