AgentSkillsCN

zeabur-migration

当服务因等待数据库迁移完成而卡住时,可选用此功能。若应用期望使用独立的迁移服务,亦可选用此功能。

SKILL.md
--- frontmatter
name: zeabur-migration
description: Use when services stuck on Waiting for database migrations to complete. Use when app expects separate migrator service.

Zeabur Migration Issues

Symptom

code
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

yaml
# 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"

Option B: Add migrator service

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).