Upgrading to 1.4
Database changes and rollout notes for Markdown diagnostics and strict checks at sync.
Upgrading to 1.4
1.4 checks the Markdown it syncs: every dry run and sync renders the pages it creates or changes with payload-markdown and reports what the renderer finds, plus broken links and anchors (Markdown diagnostics). The findings are informational: no sync is blocked unless strict checks are turned on.
Database
| Table | Change |
|---|---|
docs_sync_runs |
New column diagnostics (JSON) |
docs_sets |
New columns strict_checks (boolean, default false) and sync_diagnostics (JSON) |
_docs_sets_v |
The same columns for versions (version_strict_checks, version_sync_diagnostics) |
Every change is additive and needs no data step. Existing docs sets get strict_checks = false,
so nothing is rejected after the upgrade.
Upgrading from 1.3 needs this one migration. Without it the app fails to build or start with
column docs_sets.strict_checks does not exist.
With migrations, let Payload generate it from your config (the usual way; it also updates the migration snapshot):
1pnpm payload migrate:create docs_1_42pnpm payload migrate
Or add it by hand. The package ships the statements (Postgres, each with IF NOT EXISTS), so a
deploy that only runs payload migrate picks it up:
1// src/migrations/20261129_000000_docs_1_4.ts (and list it in src/migrations/index.ts)2import { type MigrateDownArgs, type MigrateUpArgs, sql } from '@payloadcms/db-postgres'3import { docsSyncDiagnosticsMigrationSql } from 'payload-markdown-docs/migrations'4 5const statements = docsSyncDiagnosticsMigrationSql()6 7export async function up({ db }: MigrateUpArgs): Promise<void> {8 for (const statement of statements.up) await db.execute(sql.raw(statement))9}10 11export async function down({ db }: MigrateDownArgs): Promise<void> {12 for (const statement of statements.down) await db.execute(sql.raw(statement))13}
A hand-added migration does not update Payload's snapshot, so the next migrate:create lists the
same columns again; delete those lines from that generated file.
Run the migration before the new version serves syncs: sync runs write the diagnostics column.
Dev schema push applies the columns on start. MongoDB needs nothing. Table names follow your
collection slugs if you changed them.
Rollout
- Server first, then CI. Older
pmdocsversions keep working against a 1.4 server: they send the same requests, the server checks anyway, and the results are stored on the sync run and the docs set (they do not print them). A docs set with Strict Markdown checks on rejects their syncs too; they show the findings as issues of thediagnostics_failederror. - New
pmdocs, older server. Requests without--strictare manifest version 1, as before (--full-checkadds acheckskey older servers ignore). A--strictrequest is version 2, which older servers refuse before doing anything;pmdocsthen exits 1 withdiagnostics_unavailableand nothing is written. - Renderer options. If your docs pages pass renderer options to
PayloadMarkdownDocsPage(new in 1.4), pass the same object tosync.diagnostics.renderer(Sync config). - First full check. After upgrading payload-markdown or changing themes, run
pmdocs plan --endpoint ... --full-check(or turn on strict checks, which always check every page) to see findings in pages that have not changed. - Agent skills. Run
pmdocs skill updatein docs repositories so agents learn to read diagnostics and use--strict.