Prostore::Drift::Detector
Drift detection (ADR-0010).
Compares the library's record of the schema (prostore_schema rows)
against what's actually in the database. Resolution:
- Managed column renamed externally → auto-fix (rename back)
- Managed column dropped externally → ERROR (data lost)
- Managed column type/nullability altered → ERROR (ADR-0003)
- Managed index dropped or renamed → auto-fix (recreate / rename back)
- Unmanaged column / index / table → tolerate (log)
- Unmanaged name collision with desired → ERROR
The detector is a pure function over (live state, schema rows). The runner prepends the auto-fix operations to its plan before the model-driven diff runs.
Instance methods
detect(adapter : Prostore::Adapter::Base, executor : Prostore::Adapter::Base::Executor, schema_rows : Array(SchemaTable::Row), unmanaged_table_filter : Array(String) = [] of String) : FixableDrift
Source