zeabur-migration
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseZeabur Migration Issues
Zeabur 迁移问题
Always useto invoke Zeabur CLI. Never usenpx zeabur@latestdirectly or any other installation method. Ifzeaburis not available, install Node.js first.npx
请始终使用调用 Zeabur CLI。 切勿直接使用npx zeabur@latest或其他任何安装方式。如果无法使用zeabur,请先安装 Node.js。npx
Symptom
症状
Waiting for database migrations to complete...
Waiting for database migrations to complete...
(repeating forever)Waiting for database migrations to complete...
Waiting for database migrations to complete...
(repeating forever)Cause
原因
App expects migrations to run separately, but no migrator service exists.
应用期望迁移操作独立运行,但不存在迁移服务。
Solutions
解决方案
Option A: Add migration to API startup (edit template YAML — use the zeabur-template
skill for reference)
zeabur-template选项A:将迁移添加到API启动流程中(编辑模板YAML — 可参考 zeabur-template
skill)
zeabur-templateyaml
undefinedyaml
undefinedIn api service — command MUST be inside source
In api service — command MUST be inside source
spec:
source:
image: myapp:latest
command:
- /bin/sh
- -c
- "python manage.py wait_for_db && python manage.py migrate && exec ./entrypoint.sh"
undefinedspec:
source:
image: myapp:latest
command:
- /bin/sh
- -c
- "python manage.py wait_for_db && python manage.py migrate && exec ./entrypoint.sh"
undefinedOption B: Add migrator service
选项B:添加迁移服务
yaml
- name: migrator
spec:
source:
image: same-backend-image
command:
- ./bin/docker-entrypoint-migrator.sh
env:
DATABASE_URL: ...Option A is simpler - migrations run on API startup and are idempotent (safe to repeat).
To check migration logs for errors, use the skill. If the issue is about services starting before dependencies are ready (not migration-specific), use the skill instead.
zeabur-deployment-logszeabur-startup-orderyaml
- name: migrator
spec:
source:
image: same-backend-image
command:
- ./bin/docker-entrypoint-migrator.sh
env:
DATABASE_URL: ...选项A更简单 - 迁移在API启动时运行,且具有幂等性(重复执行安全)。
要查看迁移日志排查错误,请使用 skill。如果问题是关于服务在依赖项就绪前启动(非迁移相关),请改用 skill。
zeabur-deployment-logszeabur-startup-order