ALTER TABLE
    IF EXISTS public.servizio
ADD
    CONSTRAINT servizio_doc_fronte FOREIGN KEY (doc_personale_fronte_ref) REFERENCES public.users_storage ("storageId") MATCH SIMPLE ON UPDATE CASCADE ON DELETE
SET
    NULL NOT VALID;

ALTER TABLE
    IF EXISTS public.servizio
ADD
    CONSTRAINT servizio_doc_retro FOREIGN KEY (doc_personale_retro_ref) REFERENCES public.users_storage ("storageId") MATCH SIMPLE ON UPDATE CASCADE ON DELETE
SET
    NULL NOT VALID;

ALTER TABLE
    IF EXISTS public.servizio
ADD
    CONSTRAINT servizio_doc_motivazione FOREIGN KEY (doc_motivazione_ref) REFERENCES public.users_storage ("storageId") MATCH SIMPLE ON UPDATE CASCADE ON DELETE
SET
    NULL NOT VALID;