Excluding columns
Audit columns inherited from a shared base entity (created_at, updated_at, …) repeat on every table. List their DB column names to drop them from every ERD box and column table:
mikro-orm-markdown --config ./mikro-orm.config.ts --exclude-columns created_at updated_at deleted_atOr with the programmatic API:
const markdown = await generateMarkdown({ orm: ormConfig, excludeColumns: ['created_at', 'updated_at', 'deleted_at'],});How matching works
Section titled “How matching works”- Names are matched exactly against the DB column name (as shown in the output), not the TypeScript property name. Flattened embedded columns such as
address_streetcan be listed too. - Excluding a foreign key column also removes its relation edge from the ERD. Only edges backed by a column on the entity can be removed this way —
@ManyToOneand the owning side of@OneToOne; a@ManyToManyedge has no column on the entity, so it stays. For a composite foreign key, list all of its columns; listing only some leaves the key untouched and emits a warning. - An entity that
@erdplaces in another namespace’s diagram is drawn there with only its primary-key columns. Excluding all of them (for example--exclude-columns id) removes that entity, and its relation edges, from the other namespace’s diagram; its own section is unaffected apart from the dropped columns. - Index, unique, and check constraints are always kept, even when they cover an excluded column — they describe the real schema, so
UNIQUE (email, deleted_at)still renders afterdeleted_atis excluded.