17 lines
569 B
TypeScript
17 lines
569 B
TypeScript
import { integer, text, sqliteTable } from "drizzle-orm/sqlite-core";
|
|
|
|
export const eventLog = sqliteTable("event_log", {
|
|
id: integer("id").primaryKey({ autoIncrement: true }),
|
|
timestamp: integer("timestamp", { mode: "timestamp" })
|
|
.notNull()
|
|
.$default(() => new Date()),
|
|
system: text("system").notNull(),
|
|
type: text("type").notNull(),
|
|
severity: text("severity").notNull(),
|
|
message: text("message"),
|
|
details: text("details", { mode: "json" }),
|
|
});
|
|
|
|
export type EventLog = typeof eventLog.$inferSelect;
|
|
export type NewEventLog = typeof eventLog.$inferInsert;
|