feat(db): logs, manualprints added
This commit is contained in:
2
database/migrations/0023_wealthy_marvel_boy.sql
Normal file
2
database/migrations/0023_wealthy_marvel_boy.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE "logs" ADD COLUMN "checked" boolean DEFAULT false;--> statement-breakpoint
|
||||
ALTER TABLE "logs" ADD COLUMN "checkedAt" timestamp;
|
||||
9
database/migrations/0024_curved_venom.sql
Normal file
9
database/migrations/0024_curved_venom.sql
Normal 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
|
||||
);
|
||||
1087
database/migrations/meta/0023_snapshot.json
Normal file
1087
database/migrations/meta/0023_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
1144
database/migrations/meta/0024_snapshot.json
Normal file
1144
database/migrations/meta/0024_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -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) => [
|
||||
|
||||
20
database/schema/ocpManualPrint.ts
Normal file
20
database/schema/ocpManualPrint.ts
Normal 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);
|
||||
Reference in New Issue
Block a user