argos/dmp-db-scema/updates/00.00.002_create_user_assoc...

22 lines
727 B
MySQL
Raw Permalink Normal View History

CREATE TABLE public."UserAssociation" (
id uuid NOT NULL,
"firstUser" uuid NOT NULL,
"secondUser" uuid NOT NULL
);
2020-05-12 12:10:23 +02:00
ALTER TABLE public."UserAssociation" OWNER TO :POSTGRES_USER;
ALTER TABLE ONLY public."UserAssociation"
ADD CONSTRAINT pk_user_association PRIMARY KEY (id);
ALTER TABLE ONLY public."UserAssociation"
ADD CONSTRAINT fk_userinfo_user_association_1 FOREIGN KEY ("firstUser") REFERENCES public."UserInfo"(id);
ALTER TABLE ONLY public."UserAssociation"
ADD CONSTRAINT fk_userinfo_user_association_2 FOREIGN KEY ("secondUser") REFERENCES public."UserInfo"(id);
INSERT INTO public."DBVersion" VALUES ('DMPDB', '00.00.002', '2020-05-04 13:42:00.000000+03', now(), 'Add User Association');