Add prepared tenant export archives
This commit is contained in:
19
backend/db/migrations/0054_tenant_export_jobs.sql
Normal file
19
backend/db/migrations/0054_tenant_export_jobs.sql
Normal 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");
|
||||
Reference in New Issue
Block a user