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
这个提交包含在:
+2
-2
@@ -128,8 +128,8 @@ CREATE TABLE IF NOT EXISTS operation_logs (
|
||||
CREATE TABLE IF NOT EXISTS admin_accounts (
|
||||
admin_id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
username VARCHAR(64) NOT NULL,
|
||||
password_hash CHAR(64) NOT NULL,
|
||||
password_salt CHAR(32) NOT NULL,
|
||||
password_hash VARCHAR(100) NOT NULL,
|
||||
password_salt VARCHAR(32) NOT NULL DEFAULT '',
|
||||
real_name VARCHAR(100) NOT NULL DEFAULT '',
|
||||
role VARCHAR(32) NOT NULL DEFAULT 'admin',
|
||||
status TINYINT NOT NULL DEFAULT 1,
|
||||
|
||||
在新工单中引用
屏蔽一个用户