
DO $$ 
    BEGIN
         IF EXISTS (SELECT "Id" FROM public."Versions" WHERE "Build">=3214) THEN
		RETURN;
          END IF;
 
        BEGIN
  
CREATE TABLE IF NOT EXISTS public."ProjectStatuses"
(
    "Id" bigserial NOT NULL,
    "Name" character varying(200) NOT NULL,
    "Color" character varying(12) NOT NULL,
    "Type" integer NOT NULL,
    "Icon" character varying(128) NULL,
    "ImageId" BIGINT NULL,
    "EnitiyId" BIGINT NULL, 
    "EnitiyType" BIGINT NOT NULL, 
    "Timestamp" timestamp without time zone NOT NULL DEFAULT timezone('utc'::text, now()),
    CONSTRAINT "ProjectStatuses_pkey" PRIMARY KEY ("Id")
);
        EXCEPTION
            WHEN duplicate_table THEN RAISE NOTICE 'Create table <ProjectStatuses>.';
        END;
    END;
$$

