<entity>_custom_fields table per configured entity and reads/writes it directly.
For the usage guide, see Custom fields.
How it works
- On application start, the module builds a map from joiner aliases (e.g.
seller,product) to entity names for every entity listed in its options. - Each configured entity gets a dedicated table named
<entity>_custom_fieldswith one column per declared field plus a<entity>_idforeign key. - Rows are soft-deleted (
deleted_at).
model.define models and no links — the module operates dynamically over its own tables.
Module options
Field is either a BaseField (scalar type) or an EnumField (fixed set of values). Both types are exported from the module.
Service
CustomFieldsModuleService is a plain service (not MedusaService):
| Method | Behavior |
|---|---|
list(alias, filters?, config?) | Queries the entity’s custom-fields table; supports array filters (IN) and field selection |
upsert(alias, data) | Diffs against existing rows per entity ID, inserts new rows and updates changed ones in a transaction |
delete(alias, ids) | Soft-deletes the rows for the given entity IDs |