Files
PaperClipAI/packages/db/src/migrations/0336_chilly_hulk.sql
T
DottaandPaperclip e1863d4fe7 Fence shared workspace readers and preserve projectless chat admission
Retain root source and reader provenance, recheck publication access, keep plain agent transfers independent of repository discovery, and resolve organizational projects without filesystem sources.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-12 08:12:05 -05:00

16 lines
901 B
SQL

CREATE TABLE "execution_workspace_repository_access" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"company_id" uuid NOT NULL,
"root_key" text NOT NULL,
"canonical_cwd" text NOT NULL,
"kind" text NOT NULL,
"scope_id" uuid NOT NULL,
"issue_id" uuid,
"agent_id" uuid,
"responsible_user_id" text,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "execution_workspace_repository_access" ADD CONSTRAINT "execution_workspace_repository_access_company_id_companies_id_fk" FOREIGN KEY ("company_id") REFERENCES "public"."companies"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
CREATE UNIQUE INDEX "execution_workspace_repository_access_scope_idx" ON "execution_workspace_repository_access" USING btree ("company_id","root_key","kind","scope_id");