-- SPDX-License-Identifier: LicenseRef-ConusAI-Template-1.0 create table "knowledge_auto_index" ( "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, "enabled_by" text not null, "enabled_at" text not null ); alter table "knowledge_auto_index" enable row level security; alter table "knowledge_auto_index" force row level security; create policy "knowledge_auto_index_tenant" on "knowledge_auto_index" using ("org_id" = nullif(current_setting('app.org_id', true), '')::uuid) with check ("org_id" = nullif(current_setting('app.org_id', true), '')::uuid);