migrated customer, entity and api key queries to drizzle

This commit is contained in:
John Yeo
2025-05-26 17:09:06 +01:00
parent 51a300e72d
commit e449771158
64 changed files with 1179 additions and 1968 deletions

View File

@@ -0,0 +1,10 @@
import { z } from "zod";
export const AutumnMetadataSchema = z.object({
id: z.string(),
created_at: z.number(),
expires_at: z.number(),
data: z.any(),
});
export type AutumnMetadata = z.infer<typeof AutumnMetadataSchema>;

View File

@@ -0,0 +1,9 @@
import { pgTable, text, numeric, jsonb } from "drizzle-orm/pg-core";
import { sqlNow } from "../../db/utils.js";
export const metadata = pgTable("metadata", {
id: text().primaryKey().notNull(),
created_at: numeric({ mode: "number" }).notNull().default(sqlNow),
expires_at: numeric({ mode: "number" }),
data: jsonb(),
});