DO $$ 
	DECLARE _path character varying(256) = 'patch-2025-02-13-ProjectTasks_ChangeSize';

	BEGIN
		IF EXISTS (SELECT "Id" FROM public."Versions" WHERE "Path"=_path) THEN
			RETURN;
		END IF;

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

		BEGIN
			ALTER TABLE public."ProjectTasks" ADD "KeyNew" character varying(512);
			ALTER TABLE public."ProjectTasks" ADD "TitleNew" character varying(4000);
			UPDATE public."ProjectTasks" SET "KeyNew"="Key";
            UPDATE public."ProjectTasks" SET "TitleNew"="Title";
			ALTER TABLE public."ProjectTasks" DROP "Key";
            ALTER TABLE public."ProjectTasks" RENAME "KeyNew" TO "Key";
			ALTER TABLE public."ProjectTasks" DROP "Title";
            ALTER TABLE public."ProjectTasks" RENAME "TitleNew" TO "Title";




 			INSERT INTO public."Versions" ("Path", "Build") VALUES (_path, 0);
			EXCEPTION
				WHEN OTHERS THEN RAISE NOTICE '[ERR] patch-2025-02-13-ProjectTasks_ChangeSize: %', SQLERRM;
		END;
	END;
$$