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:
5
backend/migrations/001_users.down.sql
Normal file
5
backend/migrations/001_users.down.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
-- 删除 Refresh Token 表(自动删除相关索引)
|
||||
DROP TABLE IF EXISTS refresh_tokens;
|
||||
|
||||
-- 删除用户表(自动删除相关索引)
|
||||
DROP TABLE IF EXISTS users;
|
||||
Reference in New Issue
Block a user