-- v1.2 Workflows M2: the orchestrator executes each workflow step as a normal
-- function invocation and logs it, so `pic logs` can surface (and filter by)
-- workflow-driven runs — exactly as it does for cron/queue/invoke triggers.
--
-- Add 'workflow' to the execution_logs.source CHECK (extends 0043). The column
-- default stays 'http'; this only widens the allowed set. Keep this list in
-- sync with `shared::ExecutionSource` (which gains the matching `Workflow`
-- variant) and `manager-core::OutboxSourceKind`.
--
-- Postgres has no ALTER … ALTER CONSTRAINT for a CHECK, so drop + re-add.

ALTER TABLE execution_logs DROP CONSTRAINT execution_logs_source_check;
ALTER TABLE execution_logs
    ADD CONSTRAINT execution_logs_source_check
    CHECK (source IN (
        'http', 'kv', 'docs', 'dead_letter', 'cron',
        'files', 'pubsub', 'email', 'invoke', 'queue', 'workflow'
    ));
