feat(ocme): added in ocme with endpoints base
This commit is contained in:
31
database/schema/ocme.ts
Normal file
31
database/schema/ocme.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
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 ocmeData = pgTable(
|
||||
"ocmeData",
|
||||
{
|
||||
ocme_id: uuid("ocme_id").defaultRandom().primaryKey(),
|
||||
sscc: text("sscc"),
|
||||
runningNr: numeric("runningNr").notNull(),
|
||||
completed: boolean("completed").default(false),
|
||||
lineNum: numeric("lineNum").notNull(),
|
||||
pickedUp: boolean("pickedUp").default(false),
|
||||
areaFrom: text("areaFrom").notNull(),
|
||||
add_User: text("add_User").default("LST_System").notNull(),
|
||||
add_Date: timestamp("add_Date").defaultNow(),
|
||||
upd_user: text("upd_User").default("LST_System").notNull(),
|
||||
upd_date: timestamp("upd_date").defaultNow(),
|
||||
},
|
||||
(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(ocmeData);
|
||||
Reference in New Issue
Block a user