26 lines
819 B
SQL
26 lines
819 B
SQL
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$$; |