2023-10-27 16:05:48 +02:00
|
|
|
DO $$DECLARE
|
|
|
|
this_version CONSTANT varchar := '00.01.005';
|
|
|
|
BEGIN
|
|
|
|
PERFORM * FROM "DBVersion" WHERE version = this_version;
|
|
|
|
IF FOUND THEN RETURN; END IF;
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS public."Dmp"
|
|
|
|
(
|
|
|
|
"id" uuid NOT NULL,
|
|
|
|
"label" character varying(250) COLLATE pg_catalog."default" NOT NULL,
|
|
|
|
"version" integer NOT NULL,
|
|
|
|
"status" smallint NOT NULL DEFAULT 0,
|
|
|
|
"properties" text COLLATE pg_catalog."default",
|
|
|
|
"dmp_properties" text COLLATE pg_catalog."default",
|
|
|
|
"group_id" uuid,
|
|
|
|
"description" text COLLATE pg_catalog."default",
|
|
|
|
"is_public" boolean NOT NULL DEFAULT false,
|
|
|
|
"extra_properties" text COLLATE pg_catalog."default",
|
|
|
|
"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,
|
|
|
|
"finalized_at" timestamp without time zone,
|
|
|
|
"published_at" timestamp without time zone,
|
2023-10-27 16:29:22 +02:00
|
|
|
CONSTRAINT "Dmp_pkey" PRIMARY KEY (id),
|
|
|
|
CONSTRAINT "Dmp_creator_fkey" FOREIGN KEY (creator) REFERENCES public."UserInfo" (id)
|
2023-10-27 16:05:48 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
INSERT INTO public."DBVersion" VALUES ('DMPDB', '00.01.005', '2023-10-27 12:00:00.000000+02', now(), 'Add Dmp table.');
|
|
|
|
|
|
|
|
END$$;
|