24 lines
1.0 KiB
SQL
24 lines
1.0 KiB
SQL
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"); |