mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
Convert remaining routes to Drizzle
This commit is contained in:
parent
05e45ff5aa
commit
90d522eaa3
14 changed files with 383 additions and 422 deletions
|
|
@ -132,6 +132,11 @@ export const application = pgTable(
|
|||
},
|
||||
);
|
||||
|
||||
export const applicationRelations = relations(application, ({ many }) => ({
|
||||
tokens: many(token),
|
||||
loginFlows: many(openIdLoginFlow),
|
||||
}));
|
||||
|
||||
export const token = pgTable("Token", {
|
||||
id: uuid("id").default(sql`uuid_generate_v7()`).primaryKey().notNull(),
|
||||
tokenType: text("token_type").notNull(),
|
||||
|
|
@ -337,6 +342,16 @@ export const openIdLoginFlow = pgTable("OpenIdLoginFlow", {
|
|||
issuerId: text("issuerId").notNull(),
|
||||
});
|
||||
|
||||
export const openIdLoginFlowRelations = relations(
|
||||
openIdLoginFlow,
|
||||
({ one }) => ({
|
||||
application: one(application, {
|
||||
fields: [openIdLoginFlow.applicationId],
|
||||
references: [application.id],
|
||||
}),
|
||||
}),
|
||||
);
|
||||
|
||||
export const flag = pgTable("Flag", {
|
||||
id: uuid("id").default(sql`uuid_generate_v7()`).primaryKey().notNull(),
|
||||
flagType: text("flagType").default("other").notNull(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue