DO $$ 
	DECLARE _path character varying(256) = 'patch-2024-04-17-ProjectTypes-IconId';

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


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

		BEGIN

 			ALTER TABLE public."ProjectStatuses" ADD "IconId" BIGINT NULL;
 			ALTER TABLE public."ProjectTaskTypes" ADD "IconId" BIGINT NULL;
			insert into public."Versions" ("Path", "Build") values (_path, 0);

		EXCEPTION
				WHEN OTHERS THEN RAISE NOTICE 'Alter table ProjectStatuses field IconId error.';
		END;
	END;
$$
