2024-01-24 16:49:50 +01:00
|
|
|
DO $$DECLARE
|
2024-02-21 17:37:24 +01:00
|
|
|
this_version CONSTANT varchar := '00.01.033';
|
2024-01-24 16:49:50 +01:00
|
|
|
BEGIN
|
|
|
|
PERFORM * FROM "DBVersion" WHERE version = this_version;
|
|
|
|
IF FOUND THEN RETURN; END IF;
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS public."ntf_UserContactInfo"
|
|
|
|
(
|
|
|
|
"id" uuid NOT NULL,
|
|
|
|
"user" uuid NOT NULL,
|
|
|
|
"ordinal" integer NOT NULL DEFAULT 0,
|
|
|
|
"type" smallint NOT NULL,
|
|
|
|
"value" character varying(512) COLLATE pg_catalog."default" NOT NULL,
|
|
|
|
"created_at" timestamp without time zone NOT NULL,
|
2024-01-25 11:28:21 +01:00
|
|
|
"updated_at" timestamp without time zone NOT NULL,
|
|
|
|
"is_active" smallint NOT NULL DEFAULT 1,
|
2024-01-24 16:49:50 +01:00
|
|
|
CONSTRAINT "ntf_UserContactInfo_pkey" PRIMARY KEY (id),
|
|
|
|
CONSTRAINT "ntf_UserContactInfo_user_fkey" FOREIGN KEY ("user")
|
|
|
|
REFERENCES public."ntf_User" (id) MATCH SIMPLE
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
ON DELETE NO ACTION
|
2024-02-15 17:36:46 +01:00
|
|
|
);
|
2024-01-24 16:49:50 +01:00
|
|
|
|
2024-02-21 17:37:24 +01:00
|
|
|
INSERT INTO public."DBVersion" VALUES ('DMPDB', '00.01.033', '2024-01-24 12:00:00.000000+02', now(), 'Add table ntf_UserContactInfo.');
|
2024-01-24 16:49:50 +01:00
|
|
|
|
|
|
|
END$$;
|