© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago
Mr. Lou

how to define array relations ?

i have this pgTable

export const invite = pgTable("invite", {
id: serial("id").primaryKey(),
code: text("code").unique().notNull(),
groupId: integer("group_id").references(() => group.id, { onDelete: "cascade" }).array(),
creatorId: integer("creator_id").references(() => profile.id).notNull(),
createdAt: timestamp("created_at").defaultNow().notNull(),
updatedAt: timestamp("updated_at").defaultNow().notNull(),
});

and usually with a one to many relation, i put a 'many(group)'
but i don't know if/how drizzle requires me to specify that i'm targeting groupId
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

how to define relations for friendship?
Drizzle TeamDTDrizzle Team / help
2y ago
How to define type of table with all relations included?
Drizzle TeamDTDrizzle Team / help
3y ago
define default value for array
Drizzle TeamDTDrizzle Team / help
3y ago
How do you define one-to-one relations in the same table?
Drizzle TeamDTDrizzle Team / help
3y ago