dcloud deploy host-database-branches migrate

Run a deployment's migrations on the branch and report what they did

IAM deploy:ManageHostDatabaseChanges state

The deployment names its migrate command in its bundle (`"migrate": "ews/migrate.mjs"` in .next/ews-outputs.json). The pool host reads the branch’s tables, columns, indexes, constraints and rows, runs `node <script>` from the deployment in a sandbox like the app’s with DATABASE_URL at the branch (at most 10 minutes), reads them again and answers. Read the result with get: migration.summary says it in one line ("2 columns added, the 42 existing rows stay"), migration.diff in full.

Synopsis

dcloud deploy host-database-branches migrate branchId --deployment-id deploymentId

Arguments

  • <branchId>Required

    string

    Also accepted as --branch-id. Constraints: uuid

Flags

  • --deployment-idRequired

    string

    The deployment whose migrate command runs on the branch: one of the app’s live deployments, usually the preview of the version to publish

Example

dcloud deploy host-database-branches migrate branchId --deployment-id example

Generated from the API description, the same one the API checks requests against and the CLI is built from.