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

# migrations

> Command line utilities for database migrations.

# `marvin.cli.migrations`

Command line utilities for database migrations.

## Functions

### `current`

```python theme={null}
def current()
```

Show current migration revision.

### `downgrade`

```python theme={null}
def downgrade(revision: str = typer.Argument(..., help='Revision to downgrade to'), yes: bool = typer.Option(False, '--yes', '-y', help='Confirm the destructive operation without prompting'))
```

Downgrade database to specified revision. Requires confirmation.

### `get_alembic_cfg`

```python theme={null}
def get_alembic_cfg()
```

Get the Alembic config.

### `history`

```python theme={null}
def history()
```

Show migration history.

### `reset`

```python theme={null}
def reset(yes: bool = typer.Option(False, '--yes', '-y', help='Confirm the destructive operation without prompting'))
```

Reset database by downgrading to base and upgrading to head. Requires confirmation.

### `revision`

```python theme={null}
def revision(autogenerate: bool = typer.Option(False, '--autogenerate/--no-autogenerate', help='Automatically generate migrations based on schema changes'), message: str = typer.Option(None, '--message', '-m', help='Migration message'))
```

Create a new migration revision. Developer command.

### `status`

```python theme={null}
def status()
```

Show database migration status and information.

### `upgrade`

```python theme={null}
def upgrade(revision: str = typer.Argument('head', help="Revision to upgrade to. Use 'head' for latest."))
```

Upgrade database to the latest migration.

***

**Parent Module:** [`cli`](marvin-cli)
