Skip to main content

run_migrate

Function run_migrate 

Source
pub async fn run_migrate(config: AppConfig) -> Result<()>
Expand description

Run database migrations and exit.

This mode is designed for cloud deployment workflows where database migrations need to run as a separate step before starting the application.

Phases executed:

  • Pre-init (wire runtime internals)
  • DB migration (run all pending migrations)

The process exits after migrations complete. Any errors are reported and propagated as non-zero exit codes.

ยงErrors

Returns an error if:

  • No database configuration is found
  • Gear discovery fails
  • Pre-init phase fails
  • Migration phase fails

The TLS crypto provider is installed automatically as the first step of [init_procedure] (idempotent), so callers do not need to invoke super::init_crypto_provider explicitly.