Open MercatoDocsSearch docsAPI reference

CLI

yarn db:migrate

Apply reviewed module migrations to the database configured for this workspace. Confirm the target first and inspect the command output for each module.

yarn db:migrate performs three steps in sequence:

  1. mercato generate – regenerates module registries, dependency injection bindings, entity ID maps, ORM entities, and API client.
  2. mercato db migrate – runs MikroORM migrations for every enabled module in alphabetical order.
  3. mercato entities install --global – ensures global custom entity and field definitions are synchronized.

You can also run migrations directly via the CLI:

# Using yarn script (includes generators + entity install)
yarn db:migrate

# Using CLI directly (migrations only)
yarn mercato db migrate

Usage

yarn db:migrate

The command relies on DATABASE_URL for database connectivity.

When to Run

Output

The script prints progress for each module with a progress bar showing migration application status (e.g., [====================] 3/3). Any failure aborts the remaining steps so you can resolve the issue safely.

Troubleshooting

Previous: yarn db:greenfield · Next: yarn dev:ephemeral