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

	BEGIN

		ALTER TABLE public."Users" DROP CONSTRAINT "Users_pkey";
		ALTER TABLE public."Users" ADD CONSTRAINT "PK_Users" UNIQUE ("Id");
		ALTER TABLE public."Users" ADD CONSTRAINT "UIDX_Users" UNIQUE ("Login");

		EXCEPTION
			WHEN OTHERS THEN RAISE NOTICE 'Add UNIQUE to table UserEmailSettings error.';
		END;
	END;
$$