feat(ocme cycle counts): tracking of cycle counts and when they were done
This commit is contained in:
3
database/migrations/0050_flat_nuke.sql
Normal file
3
database/migrations/0050_flat_nuke.sql
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
ALTER TABLE "qualityRequest" ALTER COLUMN "durationToMove" SET DATA TYPE integer;--> statement-breakpoint
|
||||||
|
ALTER TABLE "qualityRequest" ALTER COLUMN "palletStatus" SET DATA TYPE integer;--> statement-breakpoint
|
||||||
|
ALTER TABLE "qualityRequest" ALTER COLUMN "palletRequest" SET DATA TYPE integer;
|
||||||
10
database/migrations/0051_oval_warpath.sql
Normal file
10
database/migrations/0051_oval_warpath.sql
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
CREATE TABLE "ocmeCycleCounts" (
|
||||||
|
"ocme_id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"laneId" integer,
|
||||||
|
"warehouseName" numeric NOT NULL,
|
||||||
|
"laneName" numeric NOT NULL,
|
||||||
|
"good" boolean DEFAULT false,
|
||||||
|
"cycleCount" jsonb DEFAULT '[]'::jsonb,
|
||||||
|
"add_User" text DEFAULT 'LST_System' NOT NULL,
|
||||||
|
"add_Date" timestamp DEFAULT now()
|
||||||
|
);
|
||||||
3
database/migrations/0052_dark_human_torch.sql
Normal file
3
database/migrations/0052_dark_human_torch.sql
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
ALTER TABLE "ocmeCycleCounts" ALTER COLUMN "laneId" SET NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "ocmeCycleCounts" ALTER COLUMN "warehouseName" SET DATA TYPE text;--> statement-breakpoint
|
||||||
|
ALTER TABLE "ocmeCycleCounts" ALTER COLUMN "laneName" SET DATA TYPE text;
|
||||||
1699
database/migrations/meta/0050_snapshot.json
Normal file
1699
database/migrations/meta/0050_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
1765
database/migrations/meta/0051_snapshot.json
Normal file
1765
database/migrations/meta/0051_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
1765
database/migrations/meta/0052_snapshot.json
Normal file
1765
database/migrations/meta/0052_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -351,6 +351,27 @@
|
|||||||
"when": 1744649552936,
|
"when": 1744649552936,
|
||||||
"tag": "0049_certain_tarot",
|
"tag": "0049_certain_tarot",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 50,
|
||||||
|
"version": "7",
|
||||||
|
"when": 1744681925049,
|
||||||
|
"tag": "0050_flat_nuke",
|
||||||
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 51,
|
||||||
|
"version": "7",
|
||||||
|
"when": 1744684445081,
|
||||||
|
"tag": "0051_oval_warpath",
|
||||||
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 52,
|
||||||
|
"version": "7",
|
||||||
|
"when": 1744685129838,
|
||||||
|
"tag": "0052_dark_human_torch",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
37
database/schema/ocmeCycleCounts.ts
Normal file
37
database/schema/ocmeCycleCounts.ts
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
import {
|
||||||
|
text,
|
||||||
|
pgTable,
|
||||||
|
numeric,
|
||||||
|
timestamp,
|
||||||
|
boolean,
|
||||||
|
uuid,
|
||||||
|
integer,
|
||||||
|
jsonb,
|
||||||
|
} from "drizzle-orm/pg-core";
|
||||||
|
import { createSelectSchema } from "drizzle-zod";
|
||||||
|
|
||||||
|
export const ocmeCycleCounts = pgTable(
|
||||||
|
"ocmeCycleCounts",
|
||||||
|
{
|
||||||
|
ocme_id: uuid("ocme_id").defaultRandom().primaryKey(),
|
||||||
|
laneId: integer("laneId").notNull(),
|
||||||
|
warehouseName: text("warehouseName").notNull(),
|
||||||
|
laneName: text("laneName").notNull(),
|
||||||
|
good: boolean("good").default(false),
|
||||||
|
cycleCount: jsonb("cycleCount").default([]),
|
||||||
|
add_User: text("add_User").default("LST_System").notNull(),
|
||||||
|
add_Date: timestamp("add_Date").defaultNow(),
|
||||||
|
},
|
||||||
|
(table) => [
|
||||||
|
// uniqueIndex('emailUniqueIndex').on(sql`lower(${table.email})`),
|
||||||
|
// uniqueIndex("role_name").on(table.name),
|
||||||
|
//uniqueIndex("ocme_runningNr").on(table.runningNr),
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
// 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(ocmeCycleCounts);
|
||||||
Reference in New Issue
Block a user