-- Migration: 006_add_job_id_to_issues.sql
-- Purpose: Add job_id column to issues table for tracking pipeline execution context

-- Add job_id column to issues table
ALTER TABLE pipeline.issues ADD COLUMN IF NOT EXISTS job_id UUID;

-- Create index for filtering by job_id
CREATE INDEX IF NOT EXISTS idx_issues_job_id ON pipeline.issues(job_id);

COMMENT ON COLUMN pipeline.issues.job_id IS 'References the scraper job that triggered the pipeline execution';
