CREATE TABLE public.course_admins
(
    id integer NOT NULL DEFAULT nextval('course_admins_id_seq'::regclass),
    course_id integer NOT NULL,
    professor_id integer NOT NULL,
    assigned_at timestamp with time zone NOT NULL DEFAULT now(),
    CONSTRAINT course_admins_course_id_fkey FOREIGN KEY (course_id) REFERENCES courses(course_id) ON DELETE CASCADE,
    CONSTRAINT course_admins_professor_id_fkey FOREIGN KEY (professor_id) REFERENCES partners(partner_id) ON DELETE CASCADE,
    CONSTRAINT course_admins_pkey PRIMARY KEY (id),
    CONSTRAINT course_admins_uq UNIQUE (course_id, professor_id)
);
