Add in DB table UploadFile
This commit is contained in:
parent
dc06ba9201
commit
744160c84a
|
@ -904,6 +904,28 @@ CREATE TABLE public."UserToken" (
|
|||
|
||||
ALTER TABLE public."UserToken" OWNER TO :POSTGRES_USER;
|
||||
|
||||
--
|
||||
-- Name: FileUpload; Type: TABLE; Schema: public; Owner: :POSTGRES_USER
|
||||
--
|
||||
|
||||
CREATE TYPE EntityType AS ENUM ('DATASET', 'DMP');
|
||||
|
||||
CREATE TABLE public."FileUpload"
|
||||
(
|
||||
"ID" uuid NOT NULL,
|
||||
"Name" character varying(250) NOT NULL,
|
||||
"FileType" character varying(50) NOt NULL,
|
||||
"EntityId" uuid NOT NULL,
|
||||
"EntityType" EntityType NOT NULL,
|
||||
"CreatedAt" timestamp(6) with time zone DEFAULT now() NOT NULL,
|
||||
"IsDeleted" boolean DEFAULT false NOT NULL,
|
||||
"Creator" uuid NOT NULL,
|
||||
CONSTRAINT "File_pkey" PRIMARY KEY ("ID"),
|
||||
CONSTRAINT fk_fileupload_creator FOREIGN KEY ("Creator") REFERENCES public."UserInfo"(id)
|
||||
);
|
||||
|
||||
ALTER TABLE public."FileUpload" OWNER TO :POSTGRES_USER;
|
||||
|
||||
--
|
||||
-- Name: Content Content_pkey; Type: CONSTRAINT; Schema: public; Owner: :POSTGRES_USER
|
||||
--
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
DO $$DECLARE
|
||||
this_version CONSTANT varchar := '00.00.009';
|
||||
BEGIN
|
||||
PERFORM * FROM "DBVersion" WHERE version = this_version;
|
||||
IF FOUND THEN RETURN; END IF;
|
||||
|
||||
CREATE TYPE EntityType AS ENUM ('DATASET', 'DMP');
|
||||
|
||||
CREATE TABLE public."FileUpload"
|
||||
(
|
||||
"ID" uuid NOT NULL,
|
||||
"Name" character varying(250) NOT NULL,
|
||||
"FileType" character varying(50) NOt NULL,
|
||||
"EntityId" uuid NOT NULL,
|
||||
"EntityType" EntityType NOT NULL,
|
||||
"CreatedAt" timestamp(6) with time zone DEFAULT now() NOT NULL,
|
||||
"IsDeleted" boolean DEFAULT false NOT NULL,
|
||||
"Creator" uuid NOT NULL,
|
||||
CONSTRAINT "File_pkey" PRIMARY KEY ("ID"),
|
||||
CONSTRAINT fk_fileupload_creator FOREIGN KEY ("Creator") REFERENCES public."UserInfo"(id)
|
||||
);
|
||||
|
||||
/*ALTER TABLE public."UploadFile" OWNER TO :POSTGRES_USER;*/
|
||||
|
||||
INSERT INTO public."DBVersion" VALUES ('DMPDB', '00.00.009', '2022-03-03 15:50:00.000000+02', now(), 'Add File Table for uploaded files');
|
||||
|
||||
END$$;
|
Loading…
Reference in New Issue