feat : copy buzzy audit logs
This commit is contained in:
@@ -1,17 +1,11 @@
|
||||
CREATE TABLE "audit_log" (
|
||||
"id" bigint PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "audit_log_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 9223372036854775807 START WITH 1 CACHE 1),
|
||||
"actor_id" text NOT NULL,
|
||||
"actor_label" text NOT NULL,
|
||||
"action" varchar(64) NOT NULL,
|
||||
"target_type" varchar(32) NOT NULL,
|
||||
"target_id" text NOT NULL,
|
||||
"scope" varchar(64),
|
||||
"resulting_version" integer,
|
||||
"metadata" jsonb DEFAULT '{}'::jsonb NOT NULL,
|
||||
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
||||
"author_id" text,
|
||||
"author" text,
|
||||
"text" text NOT NULL,
|
||||
"details" jsonb DEFAULT '{}'::jsonb,
|
||||
"time" timestamp with time zone DEFAULT now() NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE INDEX "audit_log_created_idx" ON "audit_log" USING btree ("created_at","id");--> statement-breakpoint
|
||||
CREATE INDEX "audit_log_actor_created_idx" ON "audit_log" USING btree ("actor_id","created_at");--> statement-breakpoint
|
||||
CREATE INDEX "audit_log_target_created_idx" ON "audit_log" USING btree ("target_type","target_id","created_at");--> statement-breakpoint
|
||||
CREATE INDEX "audit_log_action_created_idx" ON "audit_log" USING btree ("action","created_at");
|
||||
CREATE INDEX "audit_log_time_idx" ON "audit_log" USING btree ("time","id");--> statement-breakpoint
|
||||
CREATE INDEX "audit_log_author_time_idx" ON "audit_log" USING btree ("author_id","time");
|
||||
|
||||
Reference in New Issue
Block a user