feat : copy buzzy audit logs
CI / Verify (push) Successful in 2m2s
CI / Build immutable images and deploy (push) Successful in 2m47s

This commit is contained in:
2026-09-27 17:00:25 +07:00 Unverified
parent 8ddb5896b6
commit 188cec9bda
10 changed files with 152 additions and 353 deletions
+7 -13
View File
@@ -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");
+24 -96
View File
@@ -1,5 +1,5 @@
{
"id": "cdfff9d0-72b6-44bc-9af7-79b7995f9d49",
"id": "74274cf2-88e8-40cf-84db-3333cecc34cf",
"prevId": "06235585-b969-474c-8f40-ba3a55869d1d",
"version": "7",
"dialect": "postgresql",
@@ -538,57 +538,33 @@
"cycle": false
}
},
"actor_id": {
"name": "actor_id",
"author_id": {
"name": "author_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"actor_label": {
"name": "actor_label",
"type": "text",
"primaryKey": false,
"notNull": true
},
"action": {
"name": "action",
"type": "varchar(64)",
"primaryKey": false,
"notNull": true
},
"target_type": {
"name": "target_type",
"type": "varchar(32)",
"primaryKey": false,
"notNull": true
},
"target_id": {
"name": "target_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"scope": {
"name": "scope",
"type": "varchar(64)",
"primaryKey": false,
"notNull": false
},
"resulting_version": {
"name": "resulting_version",
"type": "integer",
"author": {
"name": "author",
"type": "text",
"primaryKey": false,
"notNull": false
},
"metadata": {
"name": "metadata",
"text": {
"name": "text",
"type": "text",
"primaryKey": false,
"notNull": true
},
"details": {
"name": "details",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"notNull": false,
"default": "'{}'::jsonb"
},
"created_at": {
"name": "created_at",
"time": {
"name": "time",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
@@ -596,11 +572,11 @@
}
},
"indexes": {
"audit_log_created_idx": {
"name": "audit_log_created_idx",
"audit_log_time_idx": {
"name": "audit_log_time_idx",
"columns": [
{
"expression": "created_at",
"expression": "time",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -617,65 +593,17 @@
"method": "btree",
"with": {}
},
"audit_log_actor_created_idx": {
"name": "audit_log_actor_created_idx",
"audit_log_author_time_idx": {
"name": "audit_log_author_time_idx",
"columns": [
{
"expression": "actor_id",
"expression": "author_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "created_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"audit_log_target_created_idx": {
"name": "audit_log_target_created_idx",
"columns": [
{
"expression": "target_type",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "target_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "created_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"audit_log_action_created_idx": {
"name": "audit_log_action_created_idx",
"columns": [
{
"expression": "action",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "created_at",
"expression": "time",
"isExpression": false,
"asc": true,
"nulls": "last"
+2 -2
View File
@@ -376,9 +376,9 @@
{
"idx": 53,
"version": "7",
"when": 1790499026606,
"when": 1790503002505,
"tag": "0053_woozy_callisto",
"breakpoints": true
}
]
}
}