feat(ocp): printer sync and logging logic added

This commit is contained in:
2026-04-13 15:34:18 -05:00
parent 87f738702a
commit 80189baf90
21 changed files with 8858 additions and 10 deletions

View File

@@ -0,0 +1,24 @@
CREATE TABLE "printer_data" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"humanReadable_id" text NOT NULL,
"name" text NOT NULL,
"ipAddress" text,
"port" numeric,
"status" text,
"statusText" text,
"last_time_printed" timestamp DEFAULT now() NOT NULL,
"assigned" boolean DEFAULT false,
"remark" text,
"printDelay" numeric DEFAULT '90',
"processes" jsonb DEFAULT '[]'::jsonb,
"print_delay_override" boolean DEFAULT false,
"add_Date" timestamp DEFAULT now(),
"upd_date" timestamp DEFAULT now(),
CONSTRAINT "printer_data_humanReadable_id_unique" UNIQUE("humanReadable_id")
);
--> statement-breakpoint
ALTER TABLE "printer_log" RENAME COLUMN "name" TO "ip";--> statement-breakpoint
ALTER TABLE "printer_log" ADD COLUMN "printer_sn" text;--> statement-breakpoint
ALTER TABLE "printer_log" ADD COLUMN "condition" text NOT NULL;--> statement-breakpoint
ALTER TABLE "printer_log" ADD COLUMN "message" text;--> statement-breakpoint
CREATE UNIQUE INDEX "printer_id" ON "printer_data" USING btree ("humanReadable_id");