OpenFn / OpenFn/lightning

Remove `priority` column from runs table

Open
#4,502 1 comment 0 reactions 1 assignee View on GitHub

@stuartc is already working on this.

Since Mar 9, 2026.

fast lanes
Dominant language
Elixir
Stars
296
Forks
86
Avg merge
1d 13h
Merged PRs (30d)
50

Description

User story

As a developer, I want to remove the deprecated priority column from the
runs table now that queue-based claiming has replaced it, so the codebase
doesn't carry dead code.

Details

The priority column (Ecto.Enum with values [immediate: 0, normal: 1])
was the original mechanism for run ordering. It has been superseded by the
queue column and queue-based claim preferences.

This is a cleanup issue to be done in a release after the fast lanes
feature (Issues 1-5) is deployed and stable.

What to remove:

  • Migration: ALTER TABLE runs DROP COLUMN priority
  • field :priority from Run schema
  • Priority references in Run.for/2, Run.new/1, Run.changeset/2
  • Priority ordering in the Query module (any ORDER BY r.priority clauses)
  • Any remaining priority-related test fixtures or assertions

What to keep:

  • The queues || ["manual", "*"] fallback in WorkerChannel can stay for
    safety (handles old workers that haven't been updated)
Implementation notes
  • Search the codebase for all references to :priority and :immediate on
    the Run schema to ensure nothing is missed
  • The migration should be straightforward — priority has a default value so
    no data migration is needed, just drop the column
  • Any RunQueue implementations (including third-party or extension-based ones)
    that reference priority ordering should be updated
Release notes

Removed the deprecated priority column from the runs table. Run ordering is
now fully handled by the queue-based claiming system introduced in the fast
lanes feature.

User acceptance criteria
  • priority column no longer exists on the runs table
  • No references to priority or :immediate remain in run-related code
  • All existing tests pass (with priority references removed/updated)
  • Workers continue to function normally after the migration

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.