feat(db): logs, manualprints added

This commit is contained in:
2025-03-19 17:07:37 -05:00
parent 34b80cf236
commit 0914b53341
8 changed files with 2279 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
ALTER TABLE "logs" ADD COLUMN "checked" boolean DEFAULT false;--> statement-breakpoint
ALTER TABLE "logs" ADD COLUMN "checkedAt" timestamp;

View File

@@ -0,0 +1,9 @@
CREATE TABLE "manualPrinting" (
"print_id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"line" integer,
"printReason" text NOT NULL,
"initials" text NOT NULL,
"additionalComments" text NOT NULL,
"add_date" timestamp DEFAULT now(),
"add_user" text
);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -162,6 +162,20 @@
"when": 1742156466912,
"tag": "0022_amused_true_believers",
"breakpoints": true
},
{
"idx": 23,
"version": "7",
"when": 1742346003832,
"tag": "0023_wealthy_marvel_boy",
"breakpoints": true
},
{
"idx": 24,
"version": "7",
"when": 1742408812383,
"tag": "0024_curved_venom",
"breakpoints": true
}
]
}

View File

@@ -10,6 +10,8 @@ export const logs = pgTable(
username: text("username").default("LST_Serivce"),
service: text("service").notNull().default("system"),
message: text("message").notNull(),
checked: boolean("checked").default(false),
checkedAt: timestamp("checkedAt"),
created_at: timestamp("add_Date").defaultNow(),
},
(table) => [

View File

@@ -0,0 +1,20 @@
import {text, pgTable, timestamp, uuid, integer} from "drizzle-orm/pg-core";
import {createInsertSchema, createSelectSchema} from "drizzle-zod";
import {z} from "zod";
export const manualPrinting = pgTable("manualPrinting", {
print_id: uuid("print_id").defaultRandom().primaryKey(),
line: integer("line"),
printReason: text("printReason").notNull(),
initials: text("initials").notNull(),
additionalComments: text("additionalComments").notNull(),
add_date: timestamp("add_date").defaultNow(),
add_user: text("add_user"),
});
// Schema for inserting a user - can be used to validate API requests
// export const insertRolesSchema = createInsertSchema(roles, {
// name: z.string().min(3, {message: "Role name must be more than 3 letters"}),
// });
// Schema for selecting a Expenses - can be used to validate API responses
export const selectRolesSchema = createSelectSchema(manualPrinting);