hashtextrequiredThe hash of the code
Becomes the column hash of recovery_code.
Written at commons/data/models/identity/concepts.ts:203
A code kept for when the other ways are lost, kept as a hash and used once
Model identity. Written in commons/data/models/identity/concepts.ts:203. Identified by credential.
hashtextrequiredThe hash of the code
Becomes the column hash of recovery_code.
Written at commons/data/models/identity/concepts.ts:203
usedAtinstantoptionalWhen it was used
Becomes the column used_at of recovery_code.
Written at commons/data/models/identity/concepts.ts:301
credentialoneThe credential it is To credential. Written at commons/data/models/identity/concepts.ts:203
Projects to the table recovery_code with the primary key credential_id.
| Column | Type | Null | Role | From |
|---|---|---|---|---|
credential_id | text | false | reference | recoveryCode.credential |
hash | text | false | attribute | recoveryCode.hash |
used_at | timestamp | true | attribute | recoveryCode.usedAt |
CREATE TABLE IF NOT EXISTS "recovery_code" (
"credential_id" VARCHAR NOT NULL PRIMARY KEY,
"hash" VARCHAR NOT NULL,
"used_at" TIMESTAMPTZ,
CONSTRAINT "recovery_code_credential_id_fk" FOREIGN KEY ("credential_id") REFERENCES "credential" ("credential_id")
);CREATE TABLE IF NOT EXISTS "recovery_code" (
"credential_id" TEXT NOT NULL PRIMARY KEY,
"hash" TEXT NOT NULL,
"used_at" TIMESTAMPTZ,
CONSTRAINT "recovery_code_credential_id_fk" FOREIGN KEY ("credential_id") REFERENCES "credential" ("credential_id")
);CREATE TABLE IF NOT EXISTS "recovery_code" (
"credential_id" TEXT NOT NULL PRIMARY KEY,
"hash" TEXT NOT NULL,
"used_at" TEXT,
CONSTRAINT "recovery_code_credential_id_fk" FOREIGN KEY ("credential_id") REFERENCES "credential" ("credential_id")
);Read and written from TypeScript with the types the model gives: import { recoveryCode } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/identity.auto.ts: do not edit.
import { from } from "@intellectual-frontiers/data/sql/typed";
import { recoveryCode } from "@intellectual-frontiers/data/sql/typed/models";
const rows = await from(recoveryCode).select((s) => ({ credentialId: s.recoveryCode.credentialId, hash: s.recoveryCode.hash })).run(runner);