Bun + ElysiaJS control plane: Drizzle/Postgres schema (printers, farms, print_jobs, pgvector frame_embeddings), R2 presigned URLs, Redis Streams frame ingestion queue, REST routes, and the /ws/edge/v1 edge-gateway WebSocket uplink. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
16 lines
666 B
TypeScript
16 lines
666 B
TypeScript
import { pgTable, uuid, text, timestamp, jsonb } from "drizzle-orm/pg-core";
|
|
|
|
export const farms = pgTable("farms", {
|
|
id: uuid("id").primaryKey().defaultRandom(),
|
|
name: text("name").notNull(),
|
|
ownerId: uuid("owner_id").notNull(),
|
|
edgeProxyToken: text("edge_proxy_token").notNull(),
|
|
location: text("location"),
|
|
settings: jsonb("settings").$type<Record<string, unknown>>().default({}),
|
|
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow().notNull(),
|
|
updatedAt: timestamp("updated_at", { withTimezone: true }).defaultNow().notNull(),
|
|
});
|
|
|
|
export type Farm = typeof farms.$inferSelect;
|
|
export type NewFarm = typeof farms.$inferInsert;
|