DO $$
DECLARE
	_path  character varying(256) := 'patch-2026_04_08-AuthClients_ValidRedirectUrisV2';
	_build integer := 16449;
BEGIN
	IF EXISTS (SELECT 1 FROM public."Versions" WHERE "Path" = _path) THEN
		RETURN;
	END IF;

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

	BEGIN
		ALTER TABLE public."AuthClients" ADD COLUMN IF NOT exists "RedirectUrl" character varying(128) NULL;
		ALTER TABLE public."AuthClients" ADD COLUMN IF NOT exists "ValidRedirectUrisJson" text NULL;

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