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
- 3
- Last publish
- Jul 26, 2026
More from ylahav
View profileSimilar plugins
More in AdminSocials
Multi-platform social publishing plugin for Payload 3 with OAuth adapters, scheduling, and audit trails for Pinterest, Instagram, Facebook, and Google Business Profile.
Live Preview
Live preview for Payload CMS in Astro and any SSR/static frontend (SvelteKit, Nuxt, Next.js, plain HTML), patching the DOM without rebuilds.
Dub
A Payload CMS plugin that automatically creates and manages shortlinks using Dub.
SEO
Adds live Yoast SEO analysis to the Payload v3 document editor with a SERP preview, keyphrase checks, and readability scoring.
Info Tooltip
Moves field help text into an info icon beside the admin field label instead of a description under the field.
onpage for TanStack Start
Adds on-page editing and draft previews to TanStack Start sites that read content from Payload.