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");

View File

@@ -0,0 +1 @@
ALTER TABLE "printer_log" ADD COLUMN "name" text;

View File

@@ -0,0 +1 @@
ALTER TABLE "printer_data" ADD COLUMN "printer_sn" text;

View File

@@ -0,0 +1,3 @@
ALTER TABLE "printer_data" ALTER COLUMN "port" SET DATA TYPE integer;--> statement-breakpoint
ALTER TABLE "printer_data" ALTER COLUMN "printDelay" SET DATA TYPE integer;--> statement-breakpoint
ALTER TABLE "printer_data" ALTER COLUMN "printDelay" SET DEFAULT 90;

View File

@@ -0,0 +1 @@
ALTER TABLE "printer_log" ADD COLUMN "created_at" timestamp DEFAULT now();

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -190,6 +190,41 @@
"when": 1775786221817,
"tag": "0026_vengeful_wiccan",
"breakpoints": true
},
{
"idx": 27,
"version": "7",
"when": 1776085181774,
"tag": "0027_free_green_goblin",
"breakpoints": true
},
{
"idx": 28,
"version": "7",
"when": 1776085921073,
"tag": "0028_keen_the_fallen",
"breakpoints": true
},
{
"idx": 29,
"version": "7",
"when": 1776087535705,
"tag": "0029_gigantic_thunderbolt_ross",
"breakpoints": true
},
{
"idx": 30,
"version": "7",
"when": 1776087914328,
"tag": "0030_high_invisible_woman",
"breakpoints": true
},
{
"idx": 31,
"version": "7",
"when": 1776098377074,
"tag": "0031_numerous_the_phantom",
"breakpoints": true
}
]
}