mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2026-06-11 20:54:50 +03:00
[FEAT] Automated audit logging (#667)
* WIP event logging - new table for events and new settings view for viewing * WIP add logging * UI for log rows * rename files to Logging to prevent getting gitignore * add metadata for all logging events and colored badges in logs page * remove unneeded comment * cleanup namespace for logging * clean up backend calls * update logging to show to => from settings changes * add logging for invitations, created, deleted, and accepted * add logging for user created, updated, suspended, or removed * add logging for workspace deleted * add logging for chat logs exported * add logging for API keys, LLM, embedder, vector db, embed chat, and reset button * modify event logs * update to event log types * simplify rendering of event badges --------- Co-authored-by: timothycarambat <rambat1010@gmail.com>
This commit is contained in:
11
server/prisma/migrations/20240206211916_init/migration.sql
Normal file
11
server/prisma/migrations/20240206211916_init/migration.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "event_logs" (
|
||||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
"event" TEXT NOT NULL,
|
||||
"metadata" TEXT,
|
||||
"userId" INTEGER,
|
||||
"occurredAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "event_logs_event_idx" ON "event_logs"("event");
|
||||
@@ -181,3 +181,13 @@ model embed_chats {
|
||||
embed_config embed_configs @relation(fields: [embed_id], references: [id], onDelete: Cascade)
|
||||
users users? @relation(fields: [usersId], references: [id])
|
||||
}
|
||||
|
||||
model event_logs {
|
||||
id Int @id @default(autoincrement())
|
||||
event String
|
||||
metadata String?
|
||||
userId Int?
|
||||
occurredAt DateTime @default(now())
|
||||
|
||||
@@index([event])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user