fix: resolve password migration crash and schema constraints

- Login bcrypt migration: write password_salt = '' instead of NULL,
  which violated the NOT NULL constraint and caused 500 errors
- Schema: widen password_hash from CHAR(64) to VARCHAR(100) for bcrypt
  compatibility, add DEFAULT '' to password_salt
- init-db: add ALTER TABLE migrations for existing databases
- app.js: enrich error logging with method, path, SQL error details
这个提交包含在:
Guoguo
2026-04-28 19:14:13 -07:00
父节点 4b6e577dfb
当前提交 4ec42e7816
修改 4 个文件,包含 7 行新增5 行删除
+1 -1
查看文件
@@ -26,7 +26,7 @@ async function handle(event) {
const body = await match.handler(ctx)
return http(200, body)
} catch (err) {
console.error(err)
console.error('[ERROR]', ctx.method, ctx.path, err.code || '', err.sqlMessage || err.message, err.stack)
return http(500, fail(3001, 'server_error'))
}
}