2024-02-21 16:48:03 +01:00
|
|
|
DO $$DECLARE
|
|
|
|
this_version CONSTANT varchar := '00.01.056';
|
|
|
|
BEGIN
|
|
|
|
PERFORM * FROM "DBVersion" WHERE version = this_version;
|
|
|
|
IF FOUND THEN RETURN; END IF;
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS public."ant_EntityUser"
|
|
|
|
(
|
|
|
|
"id" uuid NOT NULL,
|
|
|
|
"entity_id" uuid NOT NULL,
|
|
|
|
"user_id" uuid NOT NULL,
|
|
|
|
"created_at" timestamp without time zone NOT NULL,
|
|
|
|
"updated_at" timestamp without time zone NOT NULL,
|
|
|
|
"is_active" smallint NOT NULL,
|
|
|
|
CONSTRAINT "ant_EntityUser_pkey" PRIMARY KEY (id),
|
|
|
|
CONSTRAINT "ant_EntityUser_user_fkey" FOREIGN KEY ("user_id")
|
2024-02-21 17:00:25 +01:00
|
|
|
REFERENCES public."ant_User" (id) MATCH SIMPLE
|
2024-02-21 16:48:03 +01:00
|
|
|
ON UPDATE NO ACTION
|
2024-02-21 17:00:25 +01:00
|
|
|
ON DELETE NO ACTION
|
2024-02-21 16:48:03 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
INSERT INTO public."DBVersion" VALUES ('DMPDB', '00.01.056', '2024-02-20 12:00:00.000000+02', now(), 'Add table ant_EntityUser.');
|
|
|
|
|
|
|
|
END$$;
|