recator placement of code
This commit is contained in:
31
backend/db/schema/datamart.schema.ts
Normal file
31
backend/db/schema/datamart.schema.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import {
|
||||
boolean,
|
||||
integer,
|
||||
pgTable,
|
||||
text,
|
||||
timestamp,
|
||||
uuid,
|
||||
} from "drizzle-orm/pg-core";
|
||||
import { createInsertSchema, createSelectSchema } from "drizzle-zod";
|
||||
import type { z } from "zod";
|
||||
|
||||
export const datamart = pgTable("datamart", {
|
||||
id: uuid("id").defaultRandom().primaryKey(),
|
||||
name: text("name").unique(),
|
||||
description: text("description").notNull(),
|
||||
query: text("query"),
|
||||
version: integer("version").default(1).notNull(),
|
||||
active: boolean("active").default(true),
|
||||
options: text("options").default(""),
|
||||
public: boolean("public_access").default(false),
|
||||
add_date: timestamp("add_date").defaultNow(),
|
||||
add_user: text("add_user").default("lst-system"),
|
||||
upd_date: timestamp("upd_date").defaultNow(),
|
||||
upd_user: text("upd_user").default("lst-system"),
|
||||
});
|
||||
|
||||
export const datamartSchema = createSelectSchema(datamart);
|
||||
export const newDataMartSchema = createInsertSchema(datamart);
|
||||
|
||||
export type Datamart = z.infer<typeof datamartSchema>;
|
||||
export type NewDatamart = z.infer<typeof newDataMartSchema>;
|
||||
Reference in New Issue
Block a user