feat(audit): change audit log action to string at db level and split file/folder actions

This commit is contained in:
yiling
2026-08-01 14:49:08 +08:00
parent 6d80f06c22
commit 5ef7716c9c
19 changed files with 192 additions and 193 deletions
@@ -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';
@@ -0,0 +1,5 @@
-- AlterTable
ALTER TABLE "audit_logs" ALTER COLUMN "action" TYPE TEXT USING "action"::text;
-- DropEnum
DROP TYPE "AuditAction";