优化数据库

This commit is contained in:
yml
2026-06-02 20:37:00 +08:00
parent 5cb2f33872
commit af754bb594
9 changed files with 206 additions and 185 deletions
+8 -4
View File
@@ -49,6 +49,12 @@ STORAGE_SECRET_ACCESS_KEY
./scripts/deploy-prod.sh --logs
```
测试阶段需要清空并重建数据库时:
```bash
./scripts/deploy-prod.sh --reset-db
```
## 3. 手动启动服务
```bash
@@ -60,10 +66,8 @@ docker compose -f deploy/docker-compose.prod.yml up -d --build
将命令中的 `change-hfb-password` 替换为 `backend/.env` 里的 `MYSQL_PASSWORD`
```bash
for file in backend/migrations/*.sql; do
docker compose -f deploy/docker-compose.prod.yml exec -T mysql \
mysql -uhfb -pchange-hfb-password hfb_sys < "$file"
done
docker compose -f deploy/docker-compose.prod.yml exec -T mysql \
mysql -uhfb -pchange-hfb-password hfb_sys < backend/migrations/000001_init.sql
```
## 5. 验证