recator placement of code
This commit is contained in:
28
backend/db/schema/logs.schema.ts
Normal file
28
backend/db/schema/logs.schema.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import {
|
||||
boolean,
|
||||
jsonb,
|
||||
pgTable,
|
||||
text,
|
||||
timestamp,
|
||||
uuid,
|
||||
} from "drizzle-orm/pg-core";
|
||||
import { createInsertSchema, createSelectSchema } from "drizzle-zod";
|
||||
import type { z } from "zod";
|
||||
|
||||
export const logs = pgTable("logs", {
|
||||
id: uuid("id").defaultRandom().primaryKey(),
|
||||
level: text("level"),
|
||||
module: text("module").notNull(),
|
||||
subModule: text("subModule"),
|
||||
message: text("message").notNull(),
|
||||
stack: jsonb("stack").default([]),
|
||||
checked: boolean("checked").default(false),
|
||||
hostname: text("hostname"),
|
||||
createdAt: timestamp("created_at").defaultNow(),
|
||||
});
|
||||
|
||||
export const logSchema = createSelectSchema(logs);
|
||||
export const newLogSchema = createInsertSchema(logs);
|
||||
|
||||
export type Log = z.infer<typeof logSchema>;
|
||||
export type NewLog = z.infer<typeof newLogSchema>;
|
||||
Reference in New Issue
Block a user