saasframe entities install
yarn saasframe entities install reads custom entity definitions from every enabled module and installs them for the desired scope. It is typically executed after yarn db:migrate or any time module metadata changes.
Usage
yarn saasframe entities install [--tenant <tenantId>] [--global] [--no-global] [--dry-run] [--force]
Aliases: --tenantId for --tenant, --dry for --dry-run.
Options
| Option | Description |
|---|---|
--tenant <id> | Limit synchronization to a single tenant. |
--global | Process only global (tenant-less) definitions. When set, omitting --no-global is recommended. |
--no-global | Skip global definitions, applying changes only to tenant-specific entries. Cannot be combined with --global. |
--dry-run | Log actions without persisting changes. Output stats are prefixed with [dry-run]. |
--force | Reinstall even when definitions appear up to date (useful after manual edits). |
Behavior
- Resolves the tenant scope based on the provided options.
- Calls
installCustomEntitiesFromModules, which compares module metadata with storedCustomEntityandCustomFieldDefrows. - Writes updates, additions, or skips unchanged entries. Cache backends (if registered) are notified for invalidation.
- Prints a summary:
Sync complete: processed=6, updated=2, fieldsChanged=5, skipped=1. When--dry-runis active the prefix becomesDry-run.
Examples
Install definitions for every tenant plus global scope:
yarn saasframe entities install
Dry-run the sync for a specific tenant:
yarn saasframe entities install --tenant 81c3b8b0-6f06-44f6-9c22-12c0d9ec3c63 --dry-run
Install only global definitions (no tenant overrides):
yarn saasframe entities install --global
Troubleshooting
- Conflicting flags – the command prints
Cannot combine --global with --no-globaland exits when incompatible options are supplied. - Cache issues – if Redis is unavailable the sync still succeeds; you may need to flush caches manually.
- No changes reported – ensure modules export
entitiesarrays orce.tsmetadata and thatyarn generatehas been run recently.