DO
$$
    DECLARE
        _path varchar(256) := 'patch-2025_11_25-DlpSettings_ReqRespmod';
    BEGIN
        IF EXISTS (SELECT 1 FROM public."Versions" WHERE "Path" = _path) THEN
            RETURN;
        END IF;

        IF EXISTS (SELECT 1 FROM public."Versions" WHERE "Build" >= 15713) THEN
            RETURN;
        END IF;

        BEGIN
            ALTER TABLE public."DlpSettings"
                ADD COLUMN IF NOT EXISTS "ReqmodService" VARCHAR(255) NULL;

            ALTER TABLE public."DlpSettings"
                ADD COLUMN IF NOT EXISTS "RespmodService" VARCHAR(255) NULL;

            INSERT INTO public."Versions" ("Path", "Build") VALUES (_path, 0);

        EXCEPTION
            WHEN OTHERS THEN
                RAISE NOTICE '[ERR] %: %', _path, SQLERRM;
        END;
    END;
$$;
