Seed files
A seed file is an instance export (JSON) that Yellow applies to tenants automatically. Seeds are how you give every new tenant its baseline data — reference tables, default categories, demo content — without importing it by hand each time.
Seeding is always gentle: it only creates instances that don't exist yet. Existing rows are never touched, so applying the same seeds twice is harmless.
Two kinds of seeds
| Kind | Lives in | Applied to |
|---|---|---|
| Shared | the shared seeds/ folder, managed from the admin area |
every tenant |
| Tenant | a seeds/ folder in one tenant's own Files |
only that tenant |
Shared seeds are for data every tenant should have. Tenant seeds are for data that belongs to a single customer or environment.
Careful with shared seeds. A shared seed reaches every tenant — including the ones you're not thinking about right now. If the data is specific to one environment, make it a tenant seed instead.
When seeds are applied
- Automatically, every time the Yellow server starts. Shared seeds first, then each tenant's own seeds.
- On demand, from the admin area: open your profile menu → Organitzacions → Llavors and click Apply seeds now. This applies both kinds to the tenant you're working in and shows a report — per file: how many instances were created and how many were skipped because they already existed.
Each file is applied as a unit: if anything inside a file fails, that file is rolled back completely and reported, and the remaining files still apply.
Managing shared seeds
The Llavors section of the admin area lists the shared seed files.
- Upload a seed… — pick a JSON export. Yellow checks it has the right shape before accepting it.
- The bin icon deletes a seed file. This does not remove instances it already created — it only stops future seeding.
- Apply seeds now — run the seeding immediately and read the report.
Managing tenant seeds
Tenant seeds are ordinary files: open the tenant's Files area, create a folder named seeds, and upload your JSON exports into it. They will be applied to that tenant on the next server start, or when someone clicks Apply seeds now while working in that tenant.
Producing a seed file
Any JSON export works as a seed:
- Open the model's instance list and shape the search (or select the rows) you want to ship.
- Export → Export results (JSON).
- Upload the file as a shared or tenant seed.
One file covers one model. When a seed's instances reference instances seeded by another file, name the files so the one with the targets sorts first — a numeric prefix works well: 01_categories.json, 02_products.json. Within a single file, order doesn't matter.
Because instances keep their identifiers, the same seeded row has the same identity in every tenant — which is exactly what lets seeds reference each other reliably.
Seeds or tenant sync?
- Use seeds for a standing baseline: data every (or one) tenant should always start with, kept up to date by replacing the file.
- Use Copying data between tenants for a one-shot copy of live data from one tenant to another.
Related
- Exporting and importing instances — how the files are produced and what's inside them.
- Copying data between tenants — bulk one-time copies.
- Tenants — the concept page.