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

 		CREATE TABLE public."UserPositions"
(
	"Id" bigserial NOT NULL,
	"UserId" bigint NOT NULL,
	"Position" character varying(512) NOT NULL,
	"ParentUserId" bigint
);

        EXCEPTION
            WHEN OTHERS THEN RAISE NOTICE 'Recreat table UserPositions.';
        END;
    END;
$$



