Instanzweite Scan-Agenten vorbereiten
This commit is contained in:
38
backend/db/schema/instance_agents.ts
Normal file
38
backend/db/schema/instance_agents.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import {
|
||||
pgTable,
|
||||
uuid,
|
||||
timestamp,
|
||||
text,
|
||||
boolean,
|
||||
jsonb,
|
||||
} from "drizzle-orm/pg-core"
|
||||
|
||||
export const instanceAgents = pgTable("instance_agents", {
|
||||
id: uuid("id").primaryKey().defaultRandom(),
|
||||
|
||||
createdAt: timestamp("created_at", { withTimezone: true })
|
||||
.notNull()
|
||||
.defaultNow(),
|
||||
|
||||
updatedAt: timestamp("updated_at", { withTimezone: true })
|
||||
.notNull()
|
||||
.defaultNow(),
|
||||
|
||||
name: text("name").notNull(),
|
||||
description: text("description"),
|
||||
|
||||
tokenPrefix: text("token_prefix").notNull(),
|
||||
tokenHash: text("token_hash").notNull().unique(),
|
||||
|
||||
active: boolean("active").notNull().default(true),
|
||||
|
||||
capabilities: jsonb("capabilities").notNull().default({ scan: true, print: false }),
|
||||
scannerNames: jsonb("scanner_names").notNull().default([]),
|
||||
printerNames: jsonb("printer_names").notNull().default([]),
|
||||
|
||||
lastSeenAt: timestamp("last_seen_at", { withTimezone: true }),
|
||||
lastDebugInfo: jsonb("last_debug_info"),
|
||||
})
|
||||
|
||||
export type InstanceAgent = typeof instanceAgents.$inferSelect
|
||||
export type NewInstanceAgent = typeof instanceAgents.$inferInsert
|
||||
Reference in New Issue
Block a user