diff --git a/dmp-db-scema/updates/Project-entity-create/DMP-add-column-project.sql b/dmp-db-scema/updates/Project-entity-create/DMP-add-column-project.sql new file mode 100644 index 000000000..e72d6afe7 --- /dev/null +++ b/dmp-db-scema/updates/Project-entity-create/DMP-add-column-project.sql @@ -0,0 +1,2 @@ +ALTER TABLE public."DMP" +ADD COLUMN "Project" uuid \ No newline at end of file diff --git a/dmp-db-scema/updates/Project-entity-create/Project-create.sql b/dmp-db-scema/updates/Project-entity-create/Project-create.sql new file mode 100644 index 000000000..7f1f6b62e --- /dev/null +++ b/dmp-db-scema/updates/Project-entity-create/Project-create.sql @@ -0,0 +1,27 @@ +CREATE TABLE public."Project" +( + "ID" uuid NOT NULL DEFAULT uuid_generate_v4(), + "Label" character varying(250) COLLATE pg_catalog."default" NOT NULL, + "Abbreviation" character varying(50) COLLATE pg_catalog."default", + "Reference" character varying COLLATE pg_catalog."default", + "Uri" character varying(250) COLLATE pg_catalog."default", + "Definition" character varying COLLATE pg_catalog."default", + "Status" smallint NOT NULL DEFAULT 0, + "Created" timestamp(4) with time zone NOT NULL DEFAULT now(), + "Modified" timestamp(4) with time zone NOT NULL DEFAULT now(), + "StartDate" timestamp(4) with time zone, + "EndDate" timestamp(4) with time zone, + "Description" text COLLATE pg_catalog."default", + "CreationUser" uuid, + "Type" numeric NOT NULL DEFAULT 0, + "Content" uuid, + CONSTRAINT "Project_pkey" PRIMARY KEY ("ID"), + CONSTRAINT fk_project_content FOREIGN KEY ("Content") + REFERENCES public."Content" ("Id") MATCH SIMPLE + ON UPDATE NO ACTION + ON DELETE NO ACTION, + CONSTRAINT fk_project_creator FOREIGN KEY ("CreationUser") + REFERENCES public."UserInfo" (id) MATCH SIMPLE + ON UPDATE NO ACTION + ON DELETE NO ACTION +) \ No newline at end of file