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

# Database Changes

> Everyday Supabase commands and how to make schema changes with migrations.

## Everyday commands

Run these from `apps/platform`.

| Command | What it does |
| - | - |
| `supabase start` | Start the local database. Data is kept between runs. |
| `supabase stop` | Stop the local database. |
| `supabase status` | Show local URLs and keys. |
| `supabase db reset` | Wipe the local database, re-run all migrations, and reload the seed data. |

After pulling changes that add a migration, run `supabase db reset` to bring your local database up to date.

## Making schema changes

Schema changes are made as **migration files** in `supabase/migrations/` and committed with your code.

> [!WARNING]
>
> Never change the production schema from the Supabase dashboard.

**1. Create a migration**

Either write the SQL yourself:

```bash theme={null}
supabase migration new <short_description>
```

or make changes in local Studio and generate the SQL from them:

```bash theme={null}
supabase db diff -f <short_description>
```

**2. Test it**

Run `supabase db reset`. This rebuilds the database from every migration, so it catches errors before they reach production.

**3. Open a PR**

Commit the migration file with the code that uses it, and open a PR into `develop`.

Migrations are applied to production separately, after the PR is merged. Check with the team before running any command against production.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.