diff --git a/README.md b/README.md index 5193af3..54553d8 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/README_CN.md b/README_CN.md index f22854d..d5b5429 100644 --- a/README_CN.md +++ b/README_CN.md @@ -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