DO $$ 
    BEGIN
        BEGIN
          IF EXISTS (SELECT "Id" FROM public."Versions" WHERE "Build">=1765) THEN
		RETURN;
          END IF;
 
	  	  CREATE INDEX "IDX_Devices_DeviceUid-UserId"
    ON public."Devices" USING btree
    ("DeviceUid" ASC NULLS LAST, "UserId" ASC NULLS LAST)
    TABLESPACE pg_default; 

CREATE INDEX "IDX_Devices_DeviceUid-Id-DevicePushToken"
    ON public."Devices" USING btree
    ("DeviceUid" ASC NULLS LAST, "Id" ASC NULLS LAST, "DevicePushToken" ASC NULLS LAST)
    TABLESPACE pg_default; 



        EXCEPTION
            WHEN duplicate_column THEN RAISE NOTICE 'index <Indexes> already exists in <Devices>.';
        END;
    END;
$$
