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),
	],
);
