-- Migration 012: Track which user attached/downloaded a repository

-- Add user_id to github_repositories to associate records with the initiating user
ALTER TABLE github_repositories
ADD COLUMN IF NOT EXISTS user_id UUID REFERENCES users(id) ON DELETE SET NULL;

-- Helpful index for filtering user-owned repositories
CREATE INDEX IF NOT EXISTS idx_github_repositories_user_id ON github_repositories(user_id);


