feat: 建立 MySQL 8 数据库基础 (#78)
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
└───────────────────────┬──────────────────────┘
|
||||
│
|
||||
┌───────────────────────▼──────────────────────┐
|
||||
│ repository SQLite 读写 │
|
||||
│ repository MySQL 8 读写 │
|
||||
│ 只有这一层能写 SQL │
|
||||
└───────────────────────┬──────────────────────┘
|
||||
│
|
||||
@@ -162,7 +162,7 @@ templates/
|
||||
|
||||
```text
|
||||
data/
|
||||
├── admin.db SQLite 数据库
|
||||
├── backup/ 迁移前 SQLite 只读备份
|
||||
├── logs/ 运行日志
|
||||
└── uploads/ 上传的 Excel 原件
|
||||
```
|
||||
@@ -212,7 +212,8 @@ func DataDir() (string, error) {
|
||||
| 直接用 `os.Getwd()` | 双击 exe 和命令行启动,当前目录不一样 |
|
||||
| 往 exe 所在目录写日志但不建 `data/` | 打包后和程序文件混在一起,升级时会被删 |
|
||||
|
||||
`[必须]` 升级方式:换掉 exe,**`data/` 原样保留**。所以数据库必须支持迁移,见 [03](03-data-model.md) §2。
|
||||
`[必须]` 升级时保留 `data/`,并先备份 MySQL。数据库结构通过 MySQL
|
||||
`schema_migrations` 只追加升级,见 [03](03-data-model.md) §2。
|
||||
|
||||
## 7. 请求流程示例
|
||||
|
||||
|
||||
Reference in New Issue
Block a user