feat(documents): add Epson scanner inbox and document shelf

This commit is contained in:
2026-09-29 12:42:05 +02:00
parent 552a90e9e1
commit 2192fa5bb4
13 changed files with 942 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
CREATE TABLE "scanner_inbox_connections" (
"tenant_id" bigint PRIMARY KEY REFERENCES "tenants"("id") ON DELETE CASCADE,
"username" text NOT NULL UNIQUE,
"password_hash" text NOT NULL,
"active" boolean NOT NULL DEFAULT true,
"created_at" timestamp with time zone NOT NULL DEFAULT now(),
"updated_at" timestamp with time zone
);
--> statement-breakpoint
CREATE TABLE "scanner_inbox_documents" (
"file_id" uuid PRIMARY KEY REFERENCES "files"("id") ON DELETE CASCADE,
"tenant_id" bigint NOT NULL REFERENCES "tenants"("id") ON DELETE CASCADE,
"remote_filename" text NOT NULL,
"checksum" text NOT NULL,
"received_at" timestamp with time zone NOT NULL DEFAULT now()
);
--> statement-breakpoint
CREATE UNIQUE INDEX "scanner_inbox_documents_filename_key" ON "scanner_inbox_documents" ("tenant_id", "remote_filename");
--> statement-breakpoint
CREATE INDEX "scanner_inbox_documents_received_idx" ON "scanner_inbox_documents" ("tenant_id", "received_at");