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

26 lines
819 B
MySQL
Raw 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,
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$$;