Expand description
Django-inspired schema migrations for siderite.
state— serializable snapshots built fromsiderite_orm::ModelMeta.operation—CreateModel,AddField,RunSQL, …autodetector— deterministicautodetector::diff.schema_editor— PostgreSQL / SQLite / MySQL DDL.loader/migration— JSON files, dependency graph, checksums.executor::Migrator— history table, migrate / rollback / dry-run.cli::run— the five management commands, called from the app binary.
See docs/MIGRATIONS.md for the file format, reversibility table and
SQLite rebuild caveat.
Re-exports§
pub use autodetector::RenameHints;pub use autodetector::diff;pub use autodetector::diff_with;pub use cli::ExitCode;pub use cli::make_migrations;pub use cli::run;pub use error::MigrationError;pub use executor::LockHolder;pub use executor::HISTORY_TABLE;pub use executor::MigrationIntent;pub use executor::Migrator;pub use executor::RecoveryEntry;pub use executor::RecoveryReport;pub use executor::Report;pub use loader::MigrationGraph;pub use loader::load_dir;pub use loader::write_migration;pub use migration::Migration;pub use operation::Operation;pub use registry::MigrationRegistry;pub use state::ConstraintState;pub use state::DbDefault;pub use state::FieldState;pub use state::ForeignKeyState;pub use state::IndexState;pub use state::ModelState;pub use state::OnDelete;pub use state::ProjectState;pub use state::SqlType;
Modules§
- autodetector
- Deterministic schema diff:
diffcompares twoProjectStates. - cli
- Reusable command runner (
makemigrations,migrate,rollback,showmigrations,squashmigrations). - error
- Errors raised by the migration loader, autodetector, executor and CLI.
- executor
- Apply and reverse migrations against a
siderite_orm::Db. - loader
- Load, validate and write JSON migration files.
- migration
- A single migration file: id, dependencies, operations, checksum.
- operation
- Schema operations recorded in a migration file.
- registry
- Runtime registry of
crate::operation::Operation::RunRustfunctions. - schema_
editor - DDL generation for PostgreSQL, SQLite and MySQL.
- squash
- Collapse a contiguous range of migrations into one.
- state
- Owned, serializable snapshots of model metadata.