CLI
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:
mercato generate – regenerates module registries, dependency injection bindings, entity ID maps, ORM entities, and API client.mercato db migrate – runs MikroORM migrations for every enabled module in alphabetical order.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
yarn db:migrate
The command relies on DATABASE_URL for database connectivity.
yarn db:generate to apply fresh diffs.yarn db:migrate over yarn initialize (which seeds data and may abort when users exist).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.
packages/<module>/src/modules/<module>/migrations. You can retry once the issue is resolved.yarn mercato entities install --force afterwards.yarn db:migrate with NODE_ENV=production pointing to a managed database that has appropriate resources.