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.1.0- Unpacked size
- 286 kB
- License
- MIT
- Last publish
- Jul 17, 2026
More from ylahav
View profileSimilar plugins
More in AdminDashboard Analytics
Adds Plausible and Google Analytics widgets to the Payload admin dashboard, navigation, collections and globals.
AI Completions
Payload plugin that generates field content through OpenAI chat completions from the admin panel.
Default Roles
Applies default role-based access control to every Payload collection, granting CRUD access to specified roles such as admin and executive.
Warding
RBAC plugin that generates user and role collections and injects fine-grained access control across Payload collections, globals, fields, and endpoints.
Iframe Tabs
Add iframes into separate tabs in the Payload admin panel.
Visual Editor
Adds a visual live editor to Payload CMS for instant content preview.