feat(labeling): added printers and machine and other data for preprinting
This commit is contained in:
34
app/src/pkg/db/schema/printers.ts
Normal file
34
app/src/pkg/db/schema/printers.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import {
|
||||
boolean,
|
||||
index,
|
||||
jsonb,
|
||||
numeric,
|
||||
pgTable,
|
||||
text,
|
||||
timestamp,
|
||||
uniqueIndex,
|
||||
uuid,
|
||||
} from "drizzle-orm/pg-core";
|
||||
|
||||
export const printers = pgTable(
|
||||
"printers",
|
||||
{
|
||||
printer_id: uuid("printer_id").defaultRandom().primaryKey(),
|
||||
humanReadableId: text("humanReadableId"),
|
||||
name: text("name").notNull(),
|
||||
ipAddress: text("ip_address"),
|
||||
port: numeric("port"),
|
||||
status: text("status"),
|
||||
statusText: text("status_text"),
|
||||
lastTimePrinted: timestamp("last_time_printed").notNull().defaultNow(),
|
||||
assigned: boolean("assigned").default(false),
|
||||
remark: text("remark"),
|
||||
printDelay: numeric("print_delay").default("90"),
|
||||
monitorState: boolean("monitor_state").default(false),
|
||||
processes: jsonb("processes").default([]),
|
||||
printDelayOverride: boolean("print_delay_override").default(false), // this will be more for if we have the lot time active but want to over ride this single line for some reason
|
||||
add_Date: timestamp("add_Date").defaultNow(),
|
||||
upd_date: timestamp("upd_date").defaultNow(),
|
||||
},
|
||||
(table) => [uniqueIndex("humanReadableId").on(table.humanReadableId)],
|
||||
);
|
||||
27
app/src/pkg/db/schema/prodLabels.ts
Normal file
27
app/src/pkg/db/schema/prodLabels.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import {
|
||||
integer,
|
||||
pgTable,
|
||||
text,
|
||||
timestamp,
|
||||
uniqueIndex,
|
||||
uuid,
|
||||
} from "drizzle-orm/pg-core";
|
||||
|
||||
export const prodlabels = pgTable(
|
||||
"prodlabels",
|
||||
{
|
||||
label_id: uuid("label_id").defaultRandom().primaryKey(),
|
||||
printerID: integer("printerID"),
|
||||
printerName: text("printerName"),
|
||||
line: integer("line"),
|
||||
runningNr: integer("runningNr").notNull(),
|
||||
status: text("status"), // printed | bookedIn | delivered | booked out
|
||||
add_user: text("add_user").default("lst"),
|
||||
add_date: timestamp("add_date").defaultNow(),
|
||||
upd_date: timestamp("upd_date").defaultNow(),
|
||||
},
|
||||
(table) => [
|
||||
//uniqueIndex("emailUniqueIndex").on(sql`lower(${table.email})`),
|
||||
uniqueIndex("runningNr").on(table.runningNr),
|
||||
],
|
||||
);
|
||||
Reference in New Issue
Block a user