39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
import {
|
|
integer,
|
|
jsonb,
|
|
pgTable,
|
|
text,
|
|
timestamp,
|
|
uuid,
|
|
} from "drizzle-orm/pg-core";
|
|
import { createInsertSchema, createSelectSchema } from "drizzle-zod";
|
|
import type { z } from "zod";
|
|
|
|
export const alplaPurchaseHistory = pgTable("alpla_purchase_history", {
|
|
id: uuid("id").defaultRandom().primaryKey(),
|
|
apo: integer("apo"),
|
|
revision: integer("revision"),
|
|
confirmed: integer("confirmed"),
|
|
status: integer("status"),
|
|
statusText: integer("status_text"),
|
|
journalNum: integer("journal_num"),
|
|
add_date: timestamp("add_date").defaultNow(),
|
|
upd_date: timestamp("upd_date").defaultNow(),
|
|
add_user: text("add_user"),
|
|
upd_user: text("upd_user"),
|
|
remark: text("remark"),
|
|
approvedStatus: text("approved_status"),
|
|
position: jsonb("position").default([]),
|
|
createdAt: timestamp("created_at").defaultNow(),
|
|
});
|
|
|
|
export const alplaPurchaseHistorySchema =
|
|
createSelectSchema(alplaPurchaseHistory);
|
|
export const newAlplaPurchaseHistorySchema =
|
|
createInsertSchema(alplaPurchaseHistory);
|
|
|
|
export type AlplaPurchaseHistory = z.infer<typeof alplaPurchaseHistorySchema>;
|
|
export type NewAlplaPurchaseHistory = z.infer<
|
|
typeof newAlplaPurchaseHistorySchema
|
|
>;
|