fix(logging): updated entire server side to the new logging system
This commit is contained in:
26
database/schema/logs.ts
Normal file
26
database/schema/logs.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
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 logs = pgTable(
|
||||
"logs",
|
||||
{
|
||||
log_id: uuid("log_id").defaultRandom().primaryKey(),
|
||||
level: text("level"),
|
||||
username: text("username").default("LST_Serivce"),
|
||||
service: text("service").notNull().default("system"),
|
||||
message: text("message").notNull(),
|
||||
created_at: timestamp("add_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(logs);
|
||||
Reference in New Issue
Block a user