unit(D8): audit_log table + migration + audit-row builder (rule 12)

This commit is contained in:
Tiel Coder
2026-11-18 18:25:30 +00:00
parent 6982a8040d
commit b664de65f5
4 changed files with 150 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
CREATE TABLE "audit_log" (
"id" text PRIMARY KEY NOT NULL,
"actor_id" text NOT NULL,
"actor_ip_hash" text,
"action" text NOT NULL,
"entity_type" text NOT NULL,
"entity_id" text,
"before_json" text DEFAULT '' NOT NULL,
"after_json" text DEFAULT '' NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE INDEX "audit_log_created_idx" ON "audit_log" USING btree ("created_at");