argos/dmp-db-scema/updates/08/04_Create_UserToken.sql

17 lines
485 B
SQL

CREATE TABLE public."UserToken" (
"Token" uuid NOT NULL,
"UserId" uuid NOT NULL,
"IssuedAt" timestamp(4) with time zone NOT NULL,
"ExpiresAt" timestamp(4) with time zone NOT NULL
);
ALTER TABLE public."UserToken" OWNER TO :POSTGRES_USER;
ALTER TABLE ONLY public."UserToken"
ADD CONSTRAINT "UserToken_pkey" PRIMARY KEY ("Token");
ALTER TABLE ONLY public."UserToken"
ADD CONSTRAINT fkey_usetoken_user FOREIGN KEY ("UserId") REFERENCES public."UserInfo"(id);