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:
--organizationIdfor--org--tenantIdfor--tenant
Behavior
- Installs or refreshes the example module’s custom entities and fields for the tenant (
installCustomEntitiesFromModules). - Creates 10 Todo records with alternating completion states scoped to the provided organization and tenant.
- Applies custom field values (
priority,severity,blocked,labels) using the shared Data Engine. - 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
--orgor--tenantis 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.