refactor(analyitics): finished analyitics as a base
This commit is contained in:
21
backend/db/schema/analytics.schema.ts
Normal file
21
backend/db/schema/analytics.schema.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { integer, pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core";
|
||||
|
||||
export const analytics = pgTable("analytics", {
|
||||
id: uuid("id").defaultRandom().primaryKey(),
|
||||
|
||||
createdAt: timestamp("created_at").defaultNow().notNull(),
|
||||
|
||||
method: text("method").notNull(),
|
||||
routePattern: text("route_pattern").notNull(),
|
||||
actualPath: text("actual_path").notNull(),
|
||||
|
||||
statusCode: integer("status_code").notNull(),
|
||||
durationMs: integer("duration_ms").notNull(),
|
||||
|
||||
module: text("module"),
|
||||
userId: text("user_id"),
|
||||
userEmail: text("user_email"),
|
||||
|
||||
ipAddress: text("ip_address"),
|
||||
userAgent: text("user_agent"),
|
||||
});
|
||||
Reference in New Issue
Block a user