feat: 编写用户表 schema 迁移脚本

- 新增 migrations/001_users.up.sql:创建 users 表和 refresh_tokens 表
- 新增 migrations/001_users.down.sql:回滚脚本
- users 表包含 id, username, password_hash, created_at, updated_at
- refresh_tokens 表包含 id, user_id, token_hash, expires_at, created_at
- 添加必要的索引优化查询性能
This commit is contained in:
hhs
2026-06-14 16:42:12 +08:00
parent 0edafbbf8a
commit bf1e24453c
2 changed files with 31 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
-- 删除 Refresh Token 表(自动删除相关索引)
DROP TABLE IF EXISTS refresh_tokens;
-- 删除用户表(自动删除相关索引)
DROP TABLE IF EXISTS users;