Replace status_id with in_progress boolean field
- Remove task_statuses lookup table and StatusID foreign key - Add InProgress boolean field to Task model - Add database migration (005_replace_status_with_in_progress) - Update all handlers, services, and repositories - Update admin frontend to display in_progress as checkbox/boolean - Remove Task Statuses tab from admin lookups page - Update tests to use InProgress instead of StatusID - Task categorization now uses InProgress for kanban column assignment 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -73,22 +73,22 @@ func ScopeNotCompleted(db *gorm.DB) *gorm.DB {
|
||||
)
|
||||
}
|
||||
|
||||
// ScopeInProgress filters to tasks with status "In Progress".
|
||||
// ScopeInProgress filters to tasks marked as in progress.
|
||||
//
|
||||
// Predicate equivalent: IsInProgress(task)
|
||||
//
|
||||
// SQL: Joins task_taskstatus and filters by name = 'In Progress'
|
||||
// SQL: in_progress = true
|
||||
func ScopeInProgress(db *gorm.DB) *gorm.DB {
|
||||
return db.Joins("LEFT JOIN task_taskstatus ON task_taskstatus.id = task_task.status_id").
|
||||
Where("task_taskstatus.name = ?", "In Progress")
|
||||
return db.Where("in_progress = ?", true)
|
||||
}
|
||||
|
||||
// ScopeNotInProgress excludes tasks with status "In Progress".
|
||||
// ScopeNotInProgress excludes tasks marked as in progress.
|
||||
//
|
||||
// Predicate equivalent: !IsInProgress(task)
|
||||
//
|
||||
// SQL: in_progress = false
|
||||
func ScopeNotInProgress(db *gorm.DB) *gorm.DB {
|
||||
return db.Joins("LEFT JOIN task_taskstatus ON task_taskstatus.id = task_task.status_id").
|
||||
Where("task_taskstatus.name != ? OR task_taskstatus.name IS NULL", "In Progress")
|
||||
return db.Where("in_progress = ?", false)
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
|
||||
Reference in New Issue
Block a user