Adding sql script for new DmpDescriptionTemplate table
This commit is contained in:
parent
752935f6e5
commit
281475bb85
|
@ -0,0 +1,22 @@
|
|||
DO $$DECLARE
|
||||
this_version CONSTANT varchar := '00.01.012';
|
||||
BEGIN
|
||||
PERFORM * FROM "DBVersion" WHERE version = this_version;
|
||||
IF FOUND THEN RETURN; END IF;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public."DmpDescriptionTemplate"
|
||||
(
|
||||
"id" uuid NOT NULL,
|
||||
"dmp" uuid NOT NULL,
|
||||
"description_template" uuid NOT NULL,
|
||||
"data" text COLLATE pg_catalog."default" NOT NULL,
|
||||
CONSTRAINT id PRIMARY KEY (id),
|
||||
CONSTRAINT "DmpDescriptionTemplate_dmp_fkey" FOREIGN KEY (dmp)
|
||||
REFERENCES public."Dmp" (id),
|
||||
CONSTRAINT "DmpDescriptionTemplate_description_template_fkey" FOREIGN KEY (description_template)
|
||||
REFERENCES public."DescriptionTemplate" (id)
|
||||
)
|
||||
|
||||
INSERT INTO public."DBVersion" VALUES ('DMPDB', '00.01.012', '2023-11-02 12:00:00.000000+02', now(), 'Add Dmp Description Template table (former DMPDatasetProfile).');
|
||||
|
||||
END$$;
|
Loading…
Reference in New Issue