Add prepared tenant export archives

This commit is contained in:
2026-07-05 12:25:39 +02:00
parent 033e74adda
commit 0a7b0448ad
6 changed files with 601 additions and 19 deletions

View File

@@ -0,0 +1,19 @@
CREATE TABLE IF NOT EXISTS "tenant_export_jobs" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone,
"completed_at" timestamp with time zone,
"tenant_id" bigint NOT NULL REFERENCES "tenants"("id") ON DELETE cascade,
"created_by" uuid REFERENCES "auth_users"("id"),
"status" text DEFAULT 'queued' NOT NULL,
"filename" text NOT NULL,
"storage_path" text,
"content_type" text DEFAULT 'application/zip' NOT NULL,
"file_size" bigint,
"error" text,
"files_total" integer DEFAULT 0 NOT NULL,
"files_done" integer DEFAULT 0 NOT NULL
);
CREATE INDEX IF NOT EXISTS "tenant_export_jobs_tenant_status_idx"
ON "tenant_export_jobs" ("tenant_id", "status");

View File

@@ -358,6 +358,13 @@
"when": 1780261200000,
"tag": "0050_outgoing_document_costcentres",
"breakpoints": true
},
{
"idx": 51,
"version": "7",
"when": 1783247083934,
"tag": "0054_tenant_export_jobs",
"breakpoints": true
}
]
}