Apply pending schema migrations CLI command.
chirp migrate --db sqlite:///app.db --migrations-dir migrations
Symmetric with the siblingchirp makemigrations (same --db/
--migrations-dirflag surface). This is a one-shot job: it connects to the
database, applies pending migrations viamigrate(),
and disconnects. It does not boot the full App (no freeze, no contract
checks) — multi-instance deploys (Railway/K8s) run this as a pre-deploy job so
replicas do not race on startup migrations.
Fail-loud: aMigrationError(a failed migration,
an invalid migrations directory, or a checksum-drift edit of a shipped
migration) is reported and exits1. Nothing is swallowed.
cli._migrate
| Name | Type | Default | Description |
|---|---|---|---|
type
|
|
— | |
qualified_name
|
|
— | |
element_type
|
|
— | |
description
|
|
— | |
source_file
|
|
— | |
line_number
|
|
— | |
is_autodoc
|
|
— | |
autodoc_element
|
|
— | |
_autodoc_template
|
|
— | |
_autodoc_url_path
|
|
— | |
_autodoc_page_type
|
|
— | |
title
|
|
— | |
doc_content_hash
|
|
— |
Symbols on this page
run_migrate
function
def run_migrate(args) -> None
Apply pending migrations from a directory.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
args
|
|
— |
View source · /home/runner/work/chirp/chirp/site/../src/chirp/cli/_migrate.py:1