Problem
020_drop_duplicate_indices unconditionally drops three indexes that duplicate primary-key constraints. If one of those indexes is already absent, dynflow:migrate aborts with PG::UndefinedObject instead of accepting that index as already removed.
This prevents Foreman from completing its database migration. The failure was reported in Foreman Redmine #31736 with Dynflow 1.4.7, and migration 020 remains functionally unchanged in Dynflow 2.0.1.
Expected behavior
Migration 020 should treat an already-absent duplicate index as the desired state and continue removing any remaining duplicate indexes.
Proposed fix
Check the indexes exposed by Sequel before dropping each one, and add a regression test for a schema where one duplicate index is already missing before migration 020 runs.
AI usage disclosure
This issue was investigated and prepared with the assistance of Codex 5.6 Sol High. The findings were reviewed before submitting.
Problem
020_drop_duplicate_indicesunconditionally drops three indexes that duplicate primary-key constraints. If one of those indexes is already absent,dynflow:migrateaborts withPG::UndefinedObjectinstead of accepting that index as already removed.This prevents Foreman from completing its database migration. The failure was reported in Foreman Redmine #31736 with Dynflow 1.4.7, and migration 020 remains functionally unchanged in Dynflow 2.0.1.
Expected behavior
Migration 020 should treat an already-absent duplicate index as the desired state and continue removing any remaining duplicate indexes.
Proposed fix
Check the indexes exposed by Sequel before dropping each one, and add a regression test for a schema where one duplicate index is already missing before migration 020 runs.
AI usage disclosure
This issue was investigated and prepared with the assistance of Codex 5.6 Sol High. The findings were reviewed before submitting.