feat(documents): prepare inbox suggestions and add entity assignments
This commit is contained in:
13
backend/db/migrations/0077_scanner_inbox_preparation.sql
Normal file
13
backend/db/migrations/0077_scanner_inbox_preparation.sql
Normal file
@@ -0,0 +1,13 @@
|
||||
ALTER TABLE "scanner_inbox_documents"
|
||||
ADD COLUMN "suggestion_status" text NOT NULL DEFAULT 'pending',
|
||||
ADD COLUMN "suggestion" jsonb,
|
||||
ADD COLUMN "suggestion_message" text,
|
||||
ADD COLUMN "suggestion_claim" uuid,
|
||||
ADD COLUMN "suggestion_updated_at" timestamptz NOT NULL DEFAULT now();
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE "scanner_inbox_documents" ADD CONSTRAINT "scanner_inbox_suggestion_status_check"
|
||||
CHECK ("suggestion_status" IN ('pending', 'processing', 'ready', 'failed'));
|
||||
--> statement-breakpoint
|
||||
CREATE INDEX "scanner_inbox_suggestion_queue_idx"
|
||||
ON "scanner_inbox_documents" ("suggestion_status", "suggestion_updated_at", "received_at")
|
||||
WHERE "filed_at" IS NULL;
|
||||
Reference in New Issue
Block a user