CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
Blame · Line-by-line history
0006_webauthn_passkeys.sql
Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.
| 2df1f8c | 1 | -- Gluecron migration 0006: Block B5 — WebAuthn passkeys. |
| 2 | ||
| 3 | --> statement-breakpoint | |
| 4 | CREATE TABLE IF NOT EXISTS "user_passkeys" ( | |
| 5 | "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, | |
| 6 | "user_id" uuid NOT NULL, | |
| 7 | "credential_id" text NOT NULL UNIQUE, | |
| 8 | "public_key" text NOT NULL, | |
| 9 | "counter" integer DEFAULT 0 NOT NULL, | |
| 10 | "transports" text, | |
| 11 | "name" text NOT NULL DEFAULT 'Passkey', | |
| 12 | "last_used_at" timestamp, | |
| 13 | "created_at" timestamp DEFAULT now() NOT NULL, | |
| 14 | CONSTRAINT "user_passkeys_user_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE cascade | |
| 15 | ); | |
| 16 | ||
| 17 | --> statement-breakpoint | |
| 18 | CREATE INDEX IF NOT EXISTS "passkeys_user" ON "user_passkeys" ("user_id"); | |
| 19 | ||
| 20 | --> statement-breakpoint | |
| 21 | CREATE TABLE IF NOT EXISTS "webauthn_challenges" ( | |
| 22 | "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, | |
| 23 | "user_id" uuid, | |
| 24 | "session_key" text NOT NULL UNIQUE, | |
| 25 | "challenge" text NOT NULL, | |
| 26 | "kind" text NOT NULL, | |
| 27 | "expires_at" timestamp NOT NULL, | |
| 28 | "created_at" timestamp DEFAULT now() NOT NULL, | |
| 29 | CONSTRAINT "webauthn_challenges_user_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE cascade | |
| 30 | ); | |
| 31 | ||
| 32 | --> statement-breakpoint | |
| 33 | CREATE INDEX IF NOT EXISTS "webauthn_challenges_expires" ON "webauthn_challenges" ("expires_at"); |