Prostore::Migration::State
CRUD over the prostore_migration and prostore_migration_step
bookkeeping tables (ADR-0009). Pure data layer; the runner orchestrates
the higher-level state transitions.
All SQL strings build placeholders via adapter.placeholder(n) so the
same code works against SQLite (?) and PostgreSQL ($N) — crystal-db
does not translate between the two.
Constants
MIGRATION_ABORTED = "aborted"
MIGRATION_COMPLETE = "complete"
MIGRATION_FAILED = "failed"
MIGRATION_PENDING = "pending"
MIGRATION_RUNNING = "running"
STEP_COMPLETE = "complete"
STEP_FAILED = "failed"
STEP_PENDING = "pending"
STEP_RUNNING = "running"
Instance methods
find_in_progress(adapter, executor : Adapter::Base::Executor) : MigrationRow | Nil
Sourceinsert_migration(adapter, executor : Adapter::Base::Executor, source_hash : String, target_hash : String) : Int64
Sourceinsert_steps(adapter, executor : Adapter::Base::Executor, migration_id : Int64, steps : Array(Steps::Kind::Any)) : Nil
Sourcemark_migration_failed(adapter, executor : Adapter::Base::Executor, id : Int64, error : String) : Nil
Sourcemark_step_complete(adapter, executor : Adapter::Base::Executor, migration_id : Int64, ordinal : Int32) : Nil
Sourcemark_step_failed(adapter, executor : Adapter::Base::Executor, migration_id : Int64, ordinal : Int32) : Nil
Source