CREATE TABLE public.notifications_log
(
    id integer NOT NULL DEFAULT nextval('notifications_log_id_seq'::regclass),
    event_type text NOT NULL,
    recipient_email text NOT NULL,
    sent_at timestamp with time zone NOT NULL DEFAULT now(),
    session_id integer,
    partner_id bigint,
    CONSTRAINT notifications_log_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES partners(partner_id) ON DELETE SET NULL,
    CONSTRAINT notifications_log_session_id_fkey FOREIGN KEY (session_id) REFERENCES sessions(session_id) ON DELETE SET NULL,
    CONSTRAINT notifications_log_pkey PRIMARY KEY (id)
);
