add log for sign in, sign out, change password, remove upload file

This commit is contained in:
2026-01-09 19:38:54 +07:00
parent 427a1040cf
commit ae39cc111f
32 changed files with 1991 additions and 212 deletions

View File

@@ -0,0 +1,16 @@
-- CreateTable
CREATE TABLE "audit" (
"id" TEXT NOT NULL,
"userId" TEXT NOT NULL,
"action" TEXT NOT NULL,
"tableName" TEXT NOT NULL,
"recordId" TEXT NOT NULL,
"oldValue" TEXT,
"newValue" TEXT,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "audit_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "audit" ADD CONSTRAINT "audit_userId_fkey" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE CASCADE;