auth_codes.cjs 362 Bytes
const tableName = 'auth_codes'

function buildTable(t) {
  t.string('email', 320).notNullable()
  t.string('purpose', 64).notNullable()
  t.text('code_hash').notNullable()
  t.datetime('expires_at', { precision: 3 }).notNullable()
  t.integer('attempts').notNullable().defaultTo(0)
  t.primary(['email', 'purpose'])
}

module.exports = { tableName, buildTable }