DO $$ 
    BEGIN
          IF EXISTS (SELECT "Id" FROM public."Versions" WHERE "Build">=1765) THEN
		RETURN;
          END IF;
        BEGIN
 		CREATE TABLE IF NOT EXISTS public."EmailDomains"
		(
			"Id" bigserial PRIMARY KEY,
			"Domain" character varying(256) NOT NULL,
			"CustomerId" INT NOT NULL,
			"ServerId" INT NOT NULL,
			"Json" text NULL DEFAULT '{}',
			"Timestamp" timestamp without time zone DEFAULT timezone('utc', now())  NOT NULL
		);
        EXCEPTION
            WHEN OTHERS THEN RAISE NOTICE 'Create table <EmailDomains>  error.';
        END;
    END;
$$



