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

# Database Map

> Database guidance for safe edits.

The full database schema was not present in this docs repo. Use source, migrations, and `docs/codebase-map.json` before editing database logic.

## Known data concepts

| Concept          | Notes                                      |
| ---------------- | ------------------------------------------ |
| Workspace        | Company account, likely keyed by `org_id`. |
| Message          | Website submission or customer email.      |
| Category         | Workspace label for routing and reporting. |
| API key          | Website integration credential.            |
| Team member      | User membership and role.                  |
| Email connection | Gmail or Outlook provider state.           |

## Safe edit rules

* Preserve `org_id` on workspace data.
* Preserve foreign key relationships.
* Preserve RLS policies.
* Migrate data before removing fields.
* Keep API payload fields backward compatible.

## Before changing tables

1. Read migrations.
2. Search all reads and writes for the table.
3. Confirm RLS policy impact.
4. Add migration and rollback plan.
5. Update docs after source changes.
