This commit is contained in:
2025-10-23 00:22:43 +08:00
parent 0881d3fbcb
commit d67ab615ce
34 changed files with 9442 additions and 1 deletions

View File

@ -0,0 +1,19 @@
-- 创建用户表 (MySQL版本)
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(50) NOT NULL UNIQUE,
password_hash VARCHAR(255) NOT NULL,
email VARCHAR(100),
is_active BOOLEAN NOT NULL DEFAULT TRUE,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
-- 创建索引
CREATE INDEX idx_users_username ON users(username);
CREATE INDEX idx_users_email ON users(email);
-- 插入默认管理员用户 (密码: admin123)
-- 这里使用bcrypt哈希后的密码
INSERT INTO users (username, password_hash, email) VALUES
('admin', '$2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/LewdBPj/RK.PJ/..2', 'admin@example.com');