The existing integer priority field represents positional ordering within a state, not semantic importance. Rename it to rank and introduce a new priority field with enum values URGENT, HIGH, MEDIUM and LOW across the entire stack. Rank is now scoped to (state, priority) so tasks are ordered within each priority group. A generated priority_rank column combines both fields into a single sortable integer for cursor pagination. Dragging a task across priority groups updates its priority automatically based on the drop position neighbors. The backend first moves the task to the new group then repositions it at the target rank. The migration defaults existing rows to MEDIUM priority and backfills ranks per (state, priority) group. Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
176 KiB
176 KiB