mirror of
https://gitea.gofwd.group/dstrawsb/ballistic-builder.git
synced 2025-12-06 02:36:44 -05:00
13 lines
367 B
TypeScript
13 lines
367 B
TypeScript
|
|
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),
|
||
|
|
}));
|