DO $$ 
    BEGIN
          IF EXISTS (SELECT "Id" FROM public."Versions" WHERE "Build">=1765) THEN
		RETURN;
          END IF;
        BEGIN

 		ALTER TABLE public."Calendars" ADD "ViewPeriod" INT DEFAULT 2 NOT NULL;
 		ALTER TABLE public."Calendars" ADD "TimeZoneId" INT NULL;


        EXCEPTION
            WHEN OTHERS THEN RAISE NOTICE 'ALTER table <ViewPeriod> and <TimeZoneId> in <Calendars> error.';
        END;
    END;
$$



