feat(club-004): club recovery: recovery codes and device reassignment

This commit is contained in:
Deploy
2026-08-26 20:47:06 +02:00
parent 3ccbf9f450
commit 3aecd2bec0
16 changed files with 510 additions and 8 deletions

View File

@@ -0,0 +1,19 @@
/**
* CLUB-004 — Club recovery codes: add index on code_fingerprint.
*
* The consumeRecoveryCode() flow looks up by fingerprint, which must be fast.
*
* @param {import('node-pg-migrate').MigrationBuilder} pgm
*/
export const up = (pgm) => {
pgm.sql(`
CREATE INDEX IF NOT EXISTS club_recovery_codes_code_fingerprint_idx
ON club_recovery_codes (code_fingerprint)
WHERE used_at IS NULL
`);
};
/** @param {import('node-pg-migrate').MigrationBuilder} pgm */
export const down = (pgm) => {
pgm.sql('DROP INDEX IF EXISTS club_recovery_codes_code_fingerprint_idx');
};