调整项目结构

This commit is contained in:
fish
2026-04-13 20:15:27 +08:00
parent 738fa72ec0
commit e3550fedac
25 changed files with 0 additions and 670 deletions

View File

@@ -0,0 +1,15 @@
-- 用户表初始化
CREATE TABLE IF NOT EXISTS users (
id SERIAL PRIMARY KEY,
username VARCHAR(50) UNIQUE NOT NULL,
password_hash VARCHAR(255) NOT NULL,
email VARCHAR(100) UNIQUE,
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
);
-- 插入测试用户(密码: 123456
-- bcrypt hash: $2b$12$REwMlLDCbzR4UpL6MWnzE.AacihwpFvQhGs7vDKTwwyNMb1qBWOTm
INSERT INTO users (username, password_hash, email)
VALUES ('admin', '$2b$12$REwMlLDCbzR4UpL6MWnzE.AacihwpFvQhGs7vDKTwwyNMb1qBWOTm', 'admin@example.com')
ON CONFLICT (username) DO NOTHING;