Skip to content

Add Missing updated_at Column to Subtasks Table #41

Description

@foxintheloop

Problem

The subtasks table in packages/shared/src/schema.sql (lines 99-106) has created_at but no updated_at column. All other tables (tasks, goals, lists) have both timestamps, making subtasks inconsistent.

Solution

  1. Add updated_at TEXT DEFAULT (datetime('now')) column to subtasks table
  2. Add trigger to auto-update on changes:
CREATE TRIGGER IF NOT EXISTS trg_subtasks_updated_at
AFTER UPDATE ON subtasks
BEGIN
  UPDATE subtasks SET updated_at = datetime('now') WHERE id = NEW.id;
END;
  1. Update shared types to include updated_at on Subtask

Files

  • packages/shared/src/schema.sql — add column and trigger
  • packages/shared/src/index.ts — update Subtask type

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions