mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-29 20:34:28 +00:00
feat(audit): change audit log action to string at db level and split file/folder actions
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
-- AlterEnum
|
||||
-- This migration adds more than one value to an enum.
|
||||
-- With PostgreSQL versions 11 and earlier, this is not possible
|
||||
-- in a single migration. This can be worked around by creating
|
||||
-- multiple migrations, each migration adding only one value to
|
||||
-- the enum.
|
||||
|
||||
|
||||
ALTER TYPE "AuditAction" ADD VALUE 'file_create';
|
||||
ALTER TYPE "AuditAction" ADD VALUE 'file_update';
|
||||
ALTER TYPE "AuditAction" ADD VALUE 'file_delete';
|
||||
ALTER TYPE "AuditAction" ADD VALUE 'folder_create';
|
||||
ALTER TYPE "AuditAction" ADD VALUE 'folder_update';
|
||||
ALTER TYPE "AuditAction" ADD VALUE 'folder_delete';
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "audit_logs" ALTER COLUMN "action" TYPE TEXT USING "action"::text;
|
||||
|
||||
-- DropEnum
|
||||
DROP TYPE "AuditAction";
|
||||
@@ -848,52 +848,10 @@ model AiUsage {
|
||||
@@index([teamId, userId, periodStart])
|
||||
}
|
||||
|
||||
enum AuditAction {
|
||||
team_create
|
||||
team_update
|
||||
team_delete
|
||||
team_member_add
|
||||
team_member_update
|
||||
team_member_remove
|
||||
project_create
|
||||
project_update
|
||||
project_delete
|
||||
project_empty_trash
|
||||
project_member_add
|
||||
project_member_update
|
||||
project_member_remove
|
||||
asset_create
|
||||
asset_update
|
||||
asset_delete
|
||||
asset_reparent
|
||||
asset_copy
|
||||
share_create
|
||||
share_update
|
||||
share_delete
|
||||
agent_create
|
||||
agent_update
|
||||
agent_delete
|
||||
skill_create
|
||||
skill_update
|
||||
skill_delete
|
||||
provider_create
|
||||
provider_update
|
||||
provider_delete
|
||||
invite_create
|
||||
invite_revoke
|
||||
metadata_field_create
|
||||
metadata_field_update
|
||||
metadata_field_delete
|
||||
comment_create
|
||||
comment_update
|
||||
comment_delete
|
||||
comment_complete
|
||||
}
|
||||
|
||||
model AuditLog {
|
||||
id String @id @default(ulid())
|
||||
action AuditAction
|
||||
teamId String @map("team_id")
|
||||
id String @id @default(ulid())
|
||||
action String
|
||||
teamId String @map("team_id")
|
||||
userId String? @map("user_id")
|
||||
projectId String? @map("project_id")
|
||||
itemId String? @map("item_id")
|
||||
|
||||
Reference in New Issue
Block a user