> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Database

> Schema catalog, ERDs, RLS patterns, and the migration workflow for the Encore OS database.

The Encore OS database is Supabase Postgres with strict Row-Level Security (RLS) on every business table. Multi-tenant isolation is enforced at the row level; queries can never accidentally cross tenants because `org_id = auth_org_id()` predicates are evaluated by the database.

## Start here

* **[Migration Workflow](/database/migration-workflow)** — from a spec to a deployed table with RLS and tests. Read this first if you're about to add or change schema.
* **[ERDs](/database/erd/FA_ERD)** — entity-relationship diagrams per core.

## RLS

* **[RLS Patterns](/database/RLS_PATTERNS)** — canonical templates (tenant, role-bounded, read/write split).
* **[RLS Coverage](/database/RLS_COVERAGE)** — gap report against business tables.

## Operations

* **[Index Optimization Report](/database/INDEX_OPTIMIZATION_REPORT)** — recent index analysis.

## Related

* **[Database Development Guide](/development/DATABASE_DEVELOPMENT_GUIDE)** — broader dev context (declarative DDL, types).
* **[Supabase CLI workflow](/development/supabase/SUPABASE_CLI_LOCAL_WORKFLOW)** — local development.
* **[Migration checklist](/migration/migration-checklist)** — rollback playbook.
