argos/dmp-db-scema/updates/00.01.018_addUserCredential...

27 lines
853 B
MySQL
Raw Permalink Normal View History

2023-11-20 16:18:12 +01:00
DO $$DECLARE
this_version CONSTANT varchar := '00.01.018';
BEGIN
PERFORM * FROM "DBVersion" WHERE version = this_version;
IF FOUND THEN RETURN; END IF;
CREATE TABLE public."UserCredential"
(
id uuid NOT NULL,
"user" uuid NOT NULL,
2024-01-16 11:26:29 +01:00
"data" character varying NULL,
2023-11-20 16:18:12 +01:00
external_id character varying(512) NOT NULL,
created_at timestamp without time zone NOT NULL,
PRIMARY KEY (id),
FOREIGN KEY ("user")
REFERENCES public."User" (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
NOT VALID
)
WITH (
OIDS = FALSE
);
INSERT INTO public."DBVersion" VALUES ('DMPDB', '00.01.018', '2023-11-20 12:00:00.000000+02', now(), 'Add table UserCredential.');
END$$;