-- =============================================================================
-- MIGRATION 006: Add course_id to registrations_true and guests
-- PURPOSE: Links each enrollment record and guest to a specific course.
-- =============================================================================

-- registrations_true
ALTER TABLE public.registrations_true
    ADD COLUMN IF NOT EXISTS course_id INT REFERENCES public.courses(course_id);

UPDATE public.registrations_true SET course_id = 1;

-- guests
ALTER TABLE public.guests
    ADD COLUMN IF NOT EXISTS course_id INT REFERENCES public.courses(course_id);

UPDATE public.guests SET course_id = 1;
