You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
argos/dmp-db-scema/updates/08/05_Create_UserRole.sql

19 lines
577 B
SQL

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'));