Skip to content

File Search: schema (FILE_SEARCH connector type, file_* tables, RLS) #1380

Closed

Description

@helpcodeai

Part of #1379.

Schema change (opened before the migration, as CONTRIBUTING asks).

  • ConnectorType.FILE_SEARCH.
  • Tables: file_sources (setup state, schedule, lease, stats, summary), file_scans (setup dry runs), file_sync_runs, file_entries (one row per file: path, size, mtime, etag, sha256, status, attempts), file_chunks (text per PDF page or ~4,000-character segment, generated tsvector('simple')), file_shares (temporary links, token stored as hash only).
  • Raw SQL: GIN on the tsvector, pg_trgm GIN on paths, a NOLOGIN role amcp_files with rights on file_* only, org_isolation RLS policies. File queries run in tenantTx + SET LOCAL ROLE amcp_files, so RLS applies even while the app role is a superuser.
  • All rows cascade on connector delete.

Cloud and self-hosted: identical schema; additive migration, nothing changes for existing connectors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions