DB Check
Finds and fixes database consistency problems across Payload collections, with duplicate merging and reference repair in the admin panel.
Installation
pnpm add @yairl/payload-db-check About
DB Check is a Payload 3 plugin that surfaces database consistency problems across your collections from inside the admin panel. It adds a DB consistency page (at `/admin/db-check` by default, configurable) and an optional sidebar shortcut. You pick a collection, choose which checks to run, and start. Everything is read-only until you explicitly run a repair, and every repair previews what it will do first. The plugin runs three checks. Duplicates finds records that share a key you define, such as `fullName` plus `birthday`; the first key field is treated as the primary identity, so records sharing it but differing elsewhere are flagged as likely-but-unconfirmed duplicates. Broken references detects relationship and upload fields pointing at documents that no longer exist, discovering every relationship field from the schema including those nested in arrays, groups, tabs and blocks. One-sided links finds two-way relationships where only one side was written, listing candidate mirror pairs from the schema for you to confirm. Repairs are opt-in and gated. Merge duplicates lets you pick the surviving record, choose per field which copy's value wins, and select which copies contribute; inbound references are repointed to the survivor before the copies are deleted, so a merge never creates the dangling references the tool exists to find, and a bulk mode merges every group where all copies match on every field. Clear broken references strips dead ids while keeping the valid ones. Rebuild references recovers a deleted record's name from another MongoDB database on the same server and re-links by name, single or in bulk. Because merging deletes records, it is enabled per collection through the `mergeable` option. Checks themselves run against any collection. The plugin registers REST endpoints under `/api/db-check` (schema, databases, run, merge, repair, fix, link), all gated by an `access` predicate that defaults to any logged-in user. The reference-rebuild feature is MongoDB-specific and reads from another database on the same server without writing to it. Styles ship as a namespaced global stylesheet, so no CSS-module setup is required in the host app.
Package info
- Package name
@yairl/payload-db-check- Latest version
0.2.0- Unpacked size
- 318 kB
- License
- MIT
- Weekly downloads
- 1
- Last publish
- Jul 26, 2026
More from ylahav
View profileSimilar plugins
More in AdminReservation and Booking Manager
Manage reservations and bookings through Payload CMS with conflict detection and scheduling.
Audit
Automatic, compliance-ready audit logging plugin for Payload CMS that records an immutable change trail across every collection.
SEO Analyzer
Payload plugin that audits page SEO in the editor sidebar with 50+ checks, a dashboard, score history, redirects and IndexNow.
Admin Nav
Customizable Payload admin sidebar with drag-and-drop reordering, per-user preferences, 70+ icons, nested sub-menus, and a visual customizer view.
Block Builder
Visual drag-and-drop block builder that stores Payload block schemas in the database so editors design and publish blocks without code changes.
Admin Theme
A shadcn-styled admin theme for Payload whose accent, radius, font, logo and navigation are configured live from the admin panel.