zeabur-migration

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Zeabur Migration Issues

Zeabur 迁移问题

Always use
npx zeabur@latest
to invoke Zeabur CLI.
Never use
zeabur
directly or any other installation method. If
npx
is not available, install Node.js first.
请始终使用
npx zeabur@latest
调用 Zeabur CLI。
切勿直接使用
zeabur
或其他任何安装方式。如果无法使用
npx
,请先安装 Node.js。

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)

选项A:将迁移添加到API启动流程中(编辑模板YAML — 可参考
zeabur-template
skill)

yaml
undefined
yaml
undefined

In 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"
undefined
spec: source: image: myapp:latest command: - /bin/sh - -c - "python manage.py wait_for_db && python manage.py migrate && exec ./entrypoint.sh"
undefined

Option 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
zeabur-deployment-logs
skill. If the issue is about services starting before dependencies are ready (not migration-specific), use the
zeabur-startup-order
skill instead.
yaml
- name: migrator
  spec:
    source:
      image: same-backend-image
      command:
        - ./bin/docker-entrypoint-migrator.sh
    env:
      DATABASE_URL: ...
选项A更简单 - 迁移在API启动时运行,且具有幂等性(重复执行安全)。
要查看迁移日志排查错误,请使用
zeabur-deployment-logs
skill。如果问题是关于服务在依赖项就绪前启动(非迁移相关),请改用
zeabur-startup-order
skill。