
DO $$ 
    BEGIN
         IF EXISTS (SELECT "Id" FROM public."Versions" WHERE "Build">=1765) THEN
		RETURN;
          END IF;
 
        BEGIN
       CREATE TABLE public."UserReactionMetrics" ( 
    "EntityId" bigint NOT NULL,
    "EntityType" bigint NOT NULL,
    "Type" integer NOT NULL,
    "Count" int NOT NULL DEFAULT(1), 
    PRIMARY KEY ("EntityId", "EntityType","Type")
);

        EXCEPTION
            WHEN duplicate_table THEN RAISE NOTICE 'Create table <UserReactionMetrics>.';
        END;
    END;
$$


