DO $$ 
    BEGIN
          IF EXISTS (SELECT "Id" FROM public."Versions" WHERE "Build">=1765) THEN
		RETURN;
          END IF;
        BEGIN
 		UPDATE public."EventCategories" SET "Name" = 'Синяя категория', "Color" = '#74C0FC' WHERE "Id" = 1;
 		UPDATE public."EventCategories" SET "Name" = 'Зеленая категория', "Color" = '#8CE99A' WHERE "Id" = 2;
 		UPDATE public."EventCategories" SET "Name" = 'Красная категория', "Color" = '#FFA8A8' WHERE "Id" = 3;
 		UPDATE public."EventCategories" SET "Name" = 'Желтая категория', "Color" = '#FFE066' WHERE "Id" = 4;

        DELETE FROM public."EventCategories" WHERE "Id" = 5;
        EXCEPTION
            WHEN OTHERS THEN RAISE NOTICE 'UPDATE field <UserId> in <EventCategories> error.';
        END;
    END;
$$
