Fix task loading - column order mismatch in SQL query

t-195·WorkTask·
·
·
·Omni/Task.hs
Created3 months ago·Updated3 months ago

Description

Edit

Task loading is broken due to column order mismatch between database and FromRow instance.

Current Issue

jr task show fails with:

ConversionFailed {errSQLType = "TEXT", errHaskellType = "Int", errMessage = "need an int"}

Root Cause

The database has columns in this order (from ALTER TABLE ADD): 1. id, title, type, parent, namespace, status, priority 2. dependencies, description, created_at, updated_at 3. complexity (added later) 4. design_doc (added later, shouldn't exist?) 5. comments (added later)

But FromRow expects: 1. id, title, type, parent, namespace, status, priority 2. complexity 3. dependencies, description 4. comments 5. created_at, updated_at

Fix

Change loadTasks query from SELECT * FROM tasks to explicitly list columns in the expected order:

SELECT id, title, type, parent, namespace, status, priority, 
       complexity, dependencies, description, comments, 
       created_at, updated_at 
FROM tasks

Also

  • Remove design_doc column if not used
  • Apply same fix to any other SELECT * queries on tasks table

Timeline (0)

No activity yet.