argos/dmp-db-scema/updates/03/10_Project-create.sql

27 lines
1.2 KiB
SQL

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
)