CREATE TABLE public."UserRole" (
    "Id" uuid DEFAULT public.uuid_generate_v4() NOT NULL,
    "Role" numeric DEFAULT 0 NOT NULL,
    "UserId" uuid NOT NULL
);


ALTER TABLE public."UserRole" OWNER TO dmptool;

ALTER TABLE ONLY public."UserRole"
    ADD CONSTRAINT "UserRole_pkey" PRIMARY KEY ("Id");

ALTER TABLE ONLY public."UserRole"
    ADD CONSTRAINT "UserRole_userId_fkey" FOREIGN KEY ("UserId") REFERENCES public."UserInfo"(id);
	

INSERT INTO public."UserRole"("Role", "UserId") VALUES (2, (SELECT public."UserInfo"."id" FROM public."UserInfo" WHERE name = 'admin'));

