module

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
Source
insert_migration(adapter, executor : Adapter::Base::Executor, source_hash : String, target_hash : String) : Int64
Source
insert_steps(adapter, executor : Adapter::Base::Executor, migration_id : Int64, steps : Array(Steps::Kind::Any)) : Nil
Source
mark_migration_aborted(adapter, executor : Adapter::Base::Executor, id : Int64) : Nil
Source
mark_migration_complete(adapter, executor : Adapter::Base::Executor, id : Int64) : Nil
Source
mark_migration_failed(adapter, executor : Adapter::Base::Executor, id : Int64, error : String) : Nil
Source
mark_migration_running(adapter, executor : Adapter::Base::Executor, id : Int64) : Nil
Source
mark_step_complete(adapter, executor : Adapter::Base::Executor, migration_id : Int64, ordinal : Int32) : Nil
Source
mark_step_failed(adapter, executor : Adapter::Base::Executor, migration_id : Int64, ordinal : Int32) : Nil
Source
mark_step_running(adapter, executor : Adapter::Base::Executor, migration_id : Int64, ordinal : Int32) : Nil
Source
steps_for(adapter, executor : Adapter::Base::Executor, migration_id : Int64) : Array(StepRow)
Source

Nested types