12 lines
563 B
SQL
12 lines
563 B
SQL
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),
|
|
"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_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");
|