test(quality): added in framrwork
This commit is contained in:
23
database/migrations/0049_certain_tarot.sql
Normal file
23
database/migrations/0049_certain_tarot.sql
Normal file
@@ -0,0 +1,23 @@
|
||||
CREATE TABLE "qualityRequest" (
|
||||
"request_id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||
"article" numeric,
|
||||
"description" text,
|
||||
"runningNr" text,
|
||||
"lotNr" numeric,
|
||||
"warehouseAtRequest" text,
|
||||
"locationAtRequest" text,
|
||||
"warehouseMovedTo" text,
|
||||
"locationMovedTo" text,
|
||||
"durationToMove" numeric,
|
||||
"locationDropOff" text,
|
||||
"palletStatus" numeric,
|
||||
"palletStatusText" text,
|
||||
"palletRequest" numeric,
|
||||
"add_date" timestamp DEFAULT now(),
|
||||
"add_user" text DEFAULT 'LST',
|
||||
"upd_date" timestamp DEFAULT now(),
|
||||
"upd_user" text DEFAULT 'LST'
|
||||
);
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE "rfidReaders" ADD COLUMN "lastTagScanned" text;--> statement-breakpoint
|
||||
ALTER TABLE "logs" DROP COLUMN "checkedAt";
|
||||
1699
database/migrations/meta/0049_snapshot.json
Normal file
1699
database/migrations/meta/0049_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -344,6 +344,13 @@
|
||||
"when": 1743946411873,
|
||||
"tag": "0048_tearful_bushwacker",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 49,
|
||||
"version": "7",
|
||||
"when": 1744649552936,
|
||||
"tag": "0049_certain_tarot",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
47
database/schema/qualityRequest.ts
Normal file
47
database/schema/qualityRequest.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import {
|
||||
text,
|
||||
pgTable,
|
||||
numeric,
|
||||
index,
|
||||
timestamp,
|
||||
boolean,
|
||||
uuid,
|
||||
uniqueIndex,
|
||||
} from "drizzle-orm/pg-core";
|
||||
import { createInsertSchema, createSelectSchema } from "drizzle-zod";
|
||||
import { z } from "zod";
|
||||
|
||||
export const qualityRequest = pgTable(
|
||||
"qualityRequest",
|
||||
{
|
||||
request_id: uuid("request_id").defaultRandom().primaryKey(),
|
||||
article: numeric("article"),
|
||||
description: text("description"),
|
||||
runningNr: text("runningNr"),
|
||||
lotNr: numeric("lotNr"),
|
||||
warehouseAtRequest: text("warehouseAtRequest"),
|
||||
locationAtRequest: text("locationAtRequest"),
|
||||
warehouseMovedTo: text("warehouseMovedTo"),
|
||||
locationMovedTo: text("locationMovedTo"),
|
||||
durationToMove: numeric("durationToMove"),
|
||||
locationDropOff: text("locationDropOff"),
|
||||
palletStatus: numeric("palletStatus"),
|
||||
palletStatusText: text("palletStatusText"),
|
||||
palletRequest: numeric("palletRequest"),
|
||||
add_date: timestamp("add_date").defaultNow(),
|
||||
add_user: text("add_user").default("LST"),
|
||||
upd_date: timestamp("upd_date").defaultNow(),
|
||||
upd_user: text("upd_user").default("LST"),
|
||||
},
|
||||
(table) => [
|
||||
// uniqueIndex('emailUniqueIndex').on(sql`lower(${table.email})`),
|
||||
// uniqueIndex("role_name").on(table.name),
|
||||
]
|
||||
);
|
||||
|
||||
// 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(qualityRequest);
|
||||
Reference in New Issue
Block a user