src/lib/db/policy-schema.ts
Linked repository file from this build.
import { jsonb, pgTable, text, timestamp } from "drizzle-orm/pg-core";
import type { SnapPolicy } from "@/programs/snap-negative/policy";
export const snapPolicyTables = pgTable("snap_policy_tables", {
id: text("id").primaryKey(),
effectiveFrom: text("effective_from").notNull().unique(),
policy: jsonb("policy").$type<SnapPolicy>().notNull(),
publishedBy: text("published_by").notNull(),
publishedAt: timestamp("published_at", { withTimezone: true, mode: "string" }).notNull(),
});