feat(user): 添加用户 token 相关字段
- 在用户表中添加 token 和 token_enddata 字段 - 为 username 添加唯一约束 - 更新 User 实体类,添加 token 和 tokenEnddata 属性
This commit is contained in:
18
sql/data.sql
18
sql/data.sql
@@ -1,11 +1,15 @@
|
||||
-- 用户表
|
||||
CREATE TABLE IF NOT EXISTS user (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
username TEXT NOT NULL UNIQUE,
|
||||
password TEXT NOT NULL,
|
||||
email TEXT,
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||
DROP TABLE IF EXISTS "user";
|
||||
CREATE TABLE "user" (
|
||||
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
"username" TEXT NOT NULL,
|
||||
"password" TEXT NOT NULL,
|
||||
"email" TEXT,
|
||||
"created_at" DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
"updated_at" DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
"token" TEXT,
|
||||
"token_enddata" DATETIME,
|
||||
UNIQUE ("username" ASC)
|
||||
);
|
||||
|
||||
-- Markdown文件表
|
||||
|
||||
Reference in New Issue
Block a user