migrated customer, entity and api key queries to drizzle
This commit is contained in:
10
shared/models/otherModels/metadataModels.ts
Normal file
10
shared/models/otherModels/metadataModels.ts
Normal 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>;
|
||||
9
shared/models/otherModels/metadataTable.ts
Normal file
9
shared/models/otherModels/metadataTable.ts
Normal 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(),
|
||||
});
|
||||
Reference in New Issue
Block a user