-- Migration 019: Make exercise goal and execution optional
-- Many wiki exercises have only goal OR execution, not both

ALTER TABLE exercises
    ALTER COLUMN goal DROP NOT NULL,
    ALTER COLUMN execution DROP NOT NULL;

-- Add CHECK constraint: at least one of goal/execution must be present
ALTER TABLE exercises
    ADD CONSTRAINT exercises_goal_or_execution_required
    CHECK (goal IS NOT NULL OR execution IS NOT NULL);
