

Why
Payload 3.91 declares an index on the parent of every localized table. template-site’s migrations create it for its own tables, but a project’s own (a collection made with make:collection, cookie consent, other plugin tables) never got it: after a sync, pnpm migrate:rebase takes the declaration into the snapshot, and migrate:create then finds nothing to write. It only costs speed on large tables, and the same can happen with any index a later Payload version adds.
What it does
pnpm migrate:indexes compares the indexes the config declares with the ones in the database and writes a project migration for those missing, with the SQL migrate:create would write. --dry-run only lists them. A missing unique index is listed with a warning and never written, since it fails on duplicate rows. It applies nothing: pnpm migrate does, afterwards.
Where to read more
The README’s “Indexes the database lacks”, next to “Checking migrations”. It refuses on a database with migrations not applied, and when the config has tables the database lacks, which are a job for migrate:create.
pnpm migrate:indexes --dry-run
pnpm migrate:indexes
pnpm migrate