30 lines
906 B
TypeScript
30 lines
906 B
TypeScript
import {
|
|
boolean,
|
|
integer,
|
|
jsonb,
|
|
pgTable,
|
|
real,
|
|
text,
|
|
timestamp,
|
|
uuid,
|
|
} from "drizzle-orm/pg-core";
|
|
import { createInsertSchema, createSelectSchema } from "drizzle-zod";
|
|
import { z } from "zod";
|
|
|
|
export const forecastData = pgTable("forecast_Data", {
|
|
id: uuid("id").defaultRandom().primaryKey(),
|
|
customerArticleNumber: text("customer_article_number"),
|
|
dateRequested: timestamp("date_requested").defaultNow(),
|
|
quantity: real("quantity"),
|
|
requestDate: timestamp("request_date").notNull(),
|
|
article: integer("article"),
|
|
customerID: integer("customer_id").notNull(),
|
|
createdAt: timestamp("created_at").defaultNow(),
|
|
});
|
|
|
|
export const forecastDataSchema = createSelectSchema(forecastData);
|
|
export const newForecastDataSchema = createInsertSchema(forecastData);
|
|
|
|
export type ForecastData = z.infer<typeof forecastDataSchema>;
|
|
export type NewForecastData = z.infer<typeof newForecastDataSchema>;
|