-- Migration 005: Add updated_at column to epics table
-- Fixes: epic_close error "column updated_at does not exist"

ALTER TABLE epics ADD COLUMN IF NOT EXISTS updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW();

-- Set existing rows to created_at value
UPDATE epics SET updated_at = created_at WHERE updated_at IS NULL;
