
DO $$DECLARE
   this_version CONSTANT varchar := '00.01.015';
BEGIN
   PERFORM * FROM "DBVersion" WHERE version = this_version;
   IF FOUND THEN RETURN; END IF;
		CREATE TABLE public."Tag"
		(
			id uuid NOT NULL,
			label character varying(250) COLLATE pg_catalog."default" NOT NULL,
			created_by uuid,
			is_active smallint NOT NULL,
			created_at timestamp without time zone NOT NULL,
			updated_at timestamp without time zone NOT NULL,
			CONSTRAINT "Tag_pkey" PRIMARY KEY (id),
			CONSTRAINT "Tag_created_by_fkey" FOREIGN KEY (created_by)
				REFERENCES public."UserInfo" (id) MATCH SIMPLE
				ON UPDATE NO ACTION
				ON DELETE NO ACTION
				NOT VALID
		)
		WITH (
			OIDS = FALSE
		)
		TABLESPACE pg_default;

INSERT INTO public."DBVersion" VALUES ('DMPDB', '00.01.015', '2023-11-20 12:00:00.000000+02', now(), 'Add table tag.');

END$$;