Skip to main content

forge_runtime/pg/migration/
mod.rs

1//! Database migration system. Lives under `pg/` with the rest of the
2//! Postgres primitives so the doctrine "all PG-touching code goes through
3//! `forge_runtime::pg`" is enforced by layout, not just by convention.
4//!
5//! # Migration types
6//!
7//! - **System migrations**: internal Forge schema, versioned as `__forge_vXXX`.
8//!   Applied before user migrations so new framework features can ship without
9//!   conflicting with user migration numbering.
10//! - **User migrations**: application schema, named `XXXX_name.sql`. Sorted
11//!   alphabetically and applied after system migrations.
12
13pub(crate) mod builtin;
14pub(crate) mod runner;
15
16pub use builtin::{
17    SYSTEM_MIGRATION_PREFIX, SystemMigration, extract_version, get_all_system_sql,
18    get_builtin_migrations, get_system_migrations, is_system_migration,
19};
20pub use runner::{
21    AppliedMigration, DriftStatus, Migration, MigrationConfig, MigrationRunner, MigrationStatus,
22    load_migrations_from_dir,
23};