Skip to main content

mercato example seed-todos

yarn mercato example seed-todos populates example Todos for a tenant/organization pair and ensures the module’s custom entity definitions are installed.

Usage

yarn mercato example seed-todos --org <organizationId> --tenant <tenantId>

Aliases:

  • --organizationId for --org
  • --tenantId for --tenant

Behavior

  1. Installs or refreshes the example module’s custom entities and fields for the tenant (installCustomEntitiesFromModules).
  2. Creates 10 Todo records with alternating completion states scoped to the provided organization and tenant.
  3. Applies custom field values (priority, severity, blocked, labels) using the shared Data Engine.
  4. Logs progress and finishes with Seeded 10 todos with custom fields for org=<id>, tenant=<id>.

Example

ORG_ID=$(yarn mercato auth list-orgs | awk 'NR==5 {print $1}')
TENANT_ID=$(yarn mercato auth list-tenants | awk 'NR==5 {print $1}')
yarn mercato example seed-todos --org "$ORG_ID" --tenant "$TENANT_ID"

Troubleshooting

  • Missing arguments – the command prints usage instructions and exits when either --org or --tenant is omitted.
  • Custom entity sync errors – ensure migrations ran and that Redis (if configured) is reachable; rerun the command after resolving connectivity issues.
  • Duplicate data – rerunning the command adds another batch of Todos. Delete or truncate the table if you want to reset the sample dataset.