This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
# {{project_name}}
这是由 iTi-Flask Copier 模板生成的业务后端项目。
业务代码只扩展框架。
不要复制、覆盖或修改框架内部实现。
## 初始化
```bash
uv sync --extra dev
uv run python -m flask --app app.py db upgrade
```
## 开发
```bash
uv run python -m flask --app app.py run --debug
uv run --extra dev pytest
```
## 数据库迁移
生成 migration:
```bash
uv run python -m flask --app app.py db migrate -m "alice add example table"
```
升级数据库:
```bash
uv run python -m flask --app app.py db upgrade
```
规则:
- `migrations/versions` 必须提交。
- migration message 第一个词写作者名,后面自由描述。
- 生产只从 `main` 执行 `flask db upgrade`。
- 框架底座不提供系统业务 migration。
## 系统业务
{%ifinclude_system%}
本项目已引入 `iti-system`。
系统能力全量引入,不拆分 migration。
同步系统 migration:
```bash
uv run python -m flask --app app.py iti-system migrations sync
uv run python -m flask --app app.py db upgrade
```
写入系统 seed:
```bash
uv run python -m flask --app app.py iti-system seed system