Replies: 2 comments 2 replies
-
Please provide a reproduction of the cyclic dependency issue.
// member.ts
import { integer, sqliteTable } from 'drizzle-orm/sqlite-core';
import { address } from './address';
export const memberTable = sqliteTable('member', {
id: integer('id').primaryKey(),
activeAddress: integer('active_address')
.notNull()
.references(() => address.id),
}); |
Beta Was this translation helpful? Give feedback.
-
Yes, there is a problem with this. I think the best way is to have the entire schema system in a single file, but this can also lead to complexity.
Consider a structure like this. The |
Beta Was this translation helpful? Give feedback.
-
How to declare relations if the schema objects are on different files? for example id like to declare a member schema and it has an activeAddress foreign key and then on another file the address schema with member foreign key. im getting cyclic dependency issues doing the examples in the docs.
Beta Was this translation helpful? Give feedback.
All reactions