plugins/README.md
2024-07-08 17:27:04 +08:00

90 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# plugins
## db.makeDB 根据简化的数据结构描述自动生成数据库表结构(自动比对,增量更新)
```
// Account 账号
User // 用户
id c12 PK // 用户ID
phone v20 U // 手机号
password v80 n // 密码
salt v50 // 随机密码
name v100 n // 名称
serverKey v200 // 服务密钥
isValid b // 是否有效
Device // 设备
id v30 PK // 设备ID
userId c12 // 当前用户
salt v50 // 随机密码
secretTime dt // 密钥生成时间
// Log 日志
LoginLog // 登录日志
id ubi AI // 登录ID
way v20 // 登录途径verifyCode/autoLogin/oneClickLogin
userId c12 I // 当前用户
deviceId v30 I // 设备ID
time dt I // 登录时间
userAgent v200 // 设备信息
requestId v20 // 请求ID
sessionId v20 // 会话ID
successful b // 是否成功
message v1024 // 登录处理失败的信息
```
## db.makeDB 缩写对照表
### types
```
c => char
v => varchar
dt => datetime
d => date
tm => time
i => int
ui => int unsigned
ti => tinyint
uti => tinyint unsigned
b => tinyint unsigned
bi => bigint
ubi => bigint unsigned
f => float
uf => float unsigned
ff => double
uff => double unsigned
si => smallint
usi => smallint unsigned
mi => middleint
umi => middleint unsigned
t => text
bb => blob
```
### indexes
```
PK => PRIMARY KEY NOT NULL
AI => PRIMARY KEY AUTOINCREMENT NOT NULL
I => index
U => unique
TI => fulltext
```
### defaults
```
ct => CURRENT_TIMESTAMP
ctu => CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
```
### null set
```
n => NULL
nn => NOT NULL
```