mirror of
https://gitea.gofwd.group/dstrawsb/ballistic-builder.git
synced 2025-12-06 02:36:44 -05:00
moved schema to a single file
This commit is contained in:
13
src/drizzle/schema/relations.ts
Normal file
13
src/drizzle/schema/relations.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { relations } from "drizzle-orm/relations";
|
||||
import { user, authenticator } from "./schema";
|
||||
|
||||
export const authenticatorRelations = relations(authenticator, ({one}) => ({
|
||||
user: one(user, {
|
||||
fields: [authenticator.userId],
|
||||
references: [user.id]
|
||||
}),
|
||||
}));
|
||||
|
||||
export const userRelations = relations(user, ({many}) => ({
|
||||
authenticators: many(authenticator),
|
||||
}));
|
||||
Reference in New Issue
Block a user