axon-lang 1.38.1

AXON v1.5.1 — first crates.io publication of the AXON language full-stack runtime. Lexer/parser/type-checker/IR generator (re-exported from axon-frontend) plus the native Rust runtime: typed channels (TypedEventBus with QoS×5, π-calculus mobility, capability extrusion via shield D8 — Fase 13.f.2), Free Monad CPS handlers (Fase 2), lease kernel + reconcile loop (Fase 3+5), Epistemic Security Kernel (ESK Fase 6), Trust Types + ReplayLog (Fase 11.a+11.c), Stateful PEM over WebSocket (Fase 11.d), Ontological Tool Synthesis (Fase 11.e), Mobile Typed Channels (Fase 13). Crate publishes as `axon-lang` to mirror the Python PyPI package; library import remains `use axon::*` so existing call sites keep working unchanged.
Documentation
//! Migrations — embedded database schema migration runner.
//!
//! Uses sqlx's built-in migration system to manage schema versions.
//! Migrations are embedded at compile time from the `migrations/` directory.
//!
//! On server startup, `run()` applies any pending migrations automatically.
//! This ensures the database schema is always up-to-date.

use crate::storage::StorageError;
use sqlx::PgPool;

/// Run all pending database migrations.
///
/// Migrations are embedded from `./migrations/` at compile time.
/// Safe to call repeatedly — already-applied migrations are skipped.
pub async fn run(pool: &PgPool) -> Result<(), StorageError> {
    tracing::info!("db_migrations_starting");

    sqlx::migrate!("./migrations")
        .run(pool)
        .await
        .map_err(|e| {
            tracing::error!(error = %e, "db_migrations_failed");
            StorageError::QueryError(format!("Migration failed: {e}"))
        })?;

    tracing::info!("db_migrations_completed");
    Ok(())
}