-- SPDX-License-Identifier: LicenseRef-ConusAI-Template-1.0 create table "knowledge_passage_set" ( "id" uuid primary key, "version" integer not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, "org_id" uuid not null, "workspace_id" uuid not null, "project_id" uuid not null, "collection_name" text not null, "file_id" uuid not null, "document_ref" text not null, "pages" text not null ); alter table "knowledge_passage_set" add constraint "knowledge_passage_set_org_id_workspace_id_project_id_collection_name_file_id_key" unique nulls not distinct ("org_id", "workspace_id", "project_id", "collection_name", "file_id"); alter table "knowledge_passage_set" enable row level security; alter table "knowledge_passage_set" force row level security; create policy "knowledge_passage_set_tenant" on "knowledge_passage_set" using ("org_id" = nullif(current_setting('app.org_id', true), '')::uuid) with check ("org_id" = nullif(current_setting('app.org_id', true), '')::uuid);