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

# Migrations

> Managing database migrations with Drizzle Kit.

# Database Migrations

Tonnex uses **Drizzle Kit** for database migrations, with schemas defined as TypeScript in `packages/db/src/schema/`.

## Development Workflow

During development, use `db:push` for rapid iteration:

```bash theme={null}
# Push schema changes directly (no migration files)
pnpm db:push
```

## Production Workflow

For production, generate and apply migration files:

```bash theme={null}
# 1. Generate migration SQL from schema changes
pnpm db:generate

# 2. Review the generated SQL in packages/db/drizzle/

# 3. Apply migrations
pnpm db:migrate
```

## Drizzle Studio

Inspect your database visually:

```bash theme={null}
pnpm db:studio
```

Opens at `https://local.drizzle.studio`.
