33 lines
1.1 KiB
SQL
33 lines
1.1 KiB
SQL
CREATE TABLE "printers" (
|
|
"printer_id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
"humanReadableId" text,
|
|
"name" text NOT NULL,
|
|
"ip_address" text,
|
|
"port" numeric,
|
|
"status" text,
|
|
"status_text" text,
|
|
"last_time_printed" timestamp DEFAULT now() NOT NULL,
|
|
"assigned" boolean DEFAULT false,
|
|
"remark" text,
|
|
"print_delay" numeric DEFAULT '90',
|
|
"monitor_state" boolean DEFAULT false,
|
|
"processes" jsonb DEFAULT '[]'::jsonb,
|
|
"print_delay_override" boolean DEFAULT false,
|
|
"add_Date" timestamp DEFAULT now(),
|
|
"upd_date" timestamp DEFAULT now()
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE TABLE "prodlabels" (
|
|
"label_id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
"printerID" integer,
|
|
"printerName" text,
|
|
"line" integer,
|
|
"runningNr" integer NOT NULL,
|
|
"status" text,
|
|
"add_user" text DEFAULT 'lst',
|
|
"add_date" timestamp DEFAULT now(),
|
|
"upd_date" timestamp DEFAULT now()
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE UNIQUE INDEX "humanReadableId" ON "printers" USING btree ("humanReadableId");--> statement-breakpoint
|
|
CREATE UNIQUE INDEX "runningNr" ON "prodlabels" USING btree ("runningNr"); |