CREATE TABLE public."Credential" (
    "Id" uuid NOT NULL,
    "Status" numeric NOT NULL,
    "Provider" numeric NOT NULL,
    "Public" character varying NOT NULL,
    "Secret" character varying NOT NULL,
    "CreationTime" timestamp(4) with time zone NOT NULL,
    "LastUpdateTime" timestamp(4) with time zone NOT NULL,
    "UserId" uuid NOT NULL,
    "ExternalId" character varying NOT NULL
);


ALTER TABLE public."Credential" OWNER TO dmptool;

ALTER TABLE ONLY public."Credential"
    ADD CONSTRAINT "Credential_pkey" PRIMARY KEY ("Id");

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

INSERT INTO public."UserInfo"(email, authorization_level, usertype, name, created, additionalinfo) VALUES ('fake@email.org', 1, 1, :'ADMIN_USERNAME', now(), '{}');

INSERT INTO public."Credential" VALUES (uuid_generate_v4(), 0, 5, :'ADMIN_USERNAME', :'ADMIN_PASSWORD', now(), now(), (SELECT public."UserInfo"."id" FROM public."UserInfo" WHERE name = 'admin'), 'dmp');

