Skip to content

fix: reconcile model index declarations - #306

Open
Linxiushen wants to merge 1 commit into
OpenHands:mainfrom
Linxiushen:fix/model-index-drift
Open

fix: reconcile model index declarations#306
Linxiushen wants to merge 1 commit into
OpenHands:mainfrom
Linxiushen:fix/model-index-drift

Conversation

@Linxiushen

Copy link
Copy Markdown
Contributor

Summary

  • remove ORM declarations for five low-value automations single-column indexes that are absent in production
  • remove the redundant automation_runs.timeout_at single-column index declaration while retaining the deployed (status, timeout_at) composite
  • add an idempotent cross-database migration so fresh databases and existing deployments converge on the same index set
  • extend SQLite migration coverage to assert the redundant indexes are absent and the required run-history/polling indexes remain

Testing

  • ran alembic upgrade head against a fresh SQLite database
  • verified resulting indexes:
    • automations: none of the five drifted single-column indexes
    • automation_runs: automation_id, status, (status, created_at), (status, timeout_at)
  • ran Alembic compare_metadata; none of the six reconciled indexes appeared in the diff
  • ruff check and ruff format --check
  • python -m py_compile on changed Python files

Fixes #252

Disclosure: This change was prepared with AI assistance. I reviewed the migration and verified it against a fresh SQLite schema.

@github-actions github-actions Bot added the type: fix A bug fix label Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reconcile model index declarations with the actual DB schema (drift)

1 participant