docs: add alembic usage instructions

This commit is contained in:
p
2026-01-17 15:40:38 +08:00
parent 4808dada49
commit 673f73e3af
2 changed files with 26 additions and 0 deletions
+13
View File
@@ -77,6 +77,19 @@ Create `.env` file and fill in API Key:
GOOGLE_API_KEY="your_google_api_key_here"
```
Initialize the database using Alembic:
```bash
# Initialize alembic (if not already initialized)
alembic init alembic
# Generate migration script
alembic revision --autogenerate -m "Initial migration"
# Apply migration to database
alembic upgrade head
```
Start backend service:
```bash
+13
View File
@@ -77,6 +77,19 @@ pip install -r requirements.txt
GOOGLE_API_KEY="your_google_api_key_here"
```
使用 Alembic 初始化数据库:
```bash
# 初始化 alembic (如果尚未初始化)
alembic init alembic
# 生成迁移脚本
alembic revision --autogenerate -m "Initial migration"
# 应用迁移到数据库
alembic upgrade head
```
启动后端服务:
```bash