2023-11-02 16:11:34 +01:00
|
|
|
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,
|
2023-11-24 11:39:26 +01:00
|
|
|
"description_template_group" uuid NOT NULL,
|
2023-11-23 13:40:44 +01:00
|
|
|
"section_id" uuid NOT NULL,
|
2023-11-02 16:55:34 +01:00
|
|
|
"created_at" timestamp without time zone NOT NULL DEFAULT now(),
|
|
|
|
"updated_at" timestamp without time zone NOT NULL DEFAULT now(),
|
|
|
|
"is_active" smallint NOT NULL DEFAULT 1,
|
2023-11-07 11:12:14 +01:00
|
|
|
CONSTRAINT "DmpDescriptionTemplate_pkey" PRIMARY KEY (id),
|
2023-11-02 16:11:34 +01:00
|
|
|
CONSTRAINT "DmpDescriptionTemplate_dmp_fkey" FOREIGN KEY (dmp)
|
2023-11-24 11:39:26 +01:00
|
|
|
REFERENCES public."Dmp" (id)
|
2023-11-22 12:31:00 +01:00
|
|
|
);
|
2023-11-02 16:11:34 +01:00
|
|
|
|
|
|
|
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$$;
|