From 0edc5aeda8c9a53b8ecb6034e6ff65e514ee4ee2 Mon Sep 17 00:00:00 2001 From: claude code agent 227 Date: Mon, 22 Jun 2026 23:46:50 +0300 Subject: [PATCH] docs(agents): clarify where DB migrations auto-apply (prod) vs not (dev) Migrations auto-run on boot only in production (the built image / start:prod); the local dev stand (pnpm dev / nest start --watch) does NOT auto-run them, so after pulling or switching branches you must apply them with 'pnpm --filter server migration:latest' or endpoints touching new columns 500 (e.g. a freshly-added ai_chats.page_id blanket-500s all of AI chat). Co-Authored-By: Claude Opus 4.8 --- AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 333445a9..48a282ad 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -210,7 +210,7 @@ pnpm --filter @docmost/mcp test # node --test (unit + mock) pnpm --filter @docmost/mcp test:e2e # MCP end-to-end against a live instance ``` -**Database migrations** (Kysely, run from `apps/server`; they auto-run on server startup too): +**Database migrations** (Kysely, run from `apps/server`). **Where they auto-apply:** in **production** (the built image / `start:prod`) pending migrations run automatically on server boot. In **local dev** (the `pnpm dev` stand / `nest start --watch`) they do **NOT** auto-run — after you pull or switch branches you must apply them yourself with `pnpm --filter server migration:latest`, or any endpoint touching a new column/table 500s (e.g. a freshly-added `ai_chats.page_id` blanket-500s all of AI chat until migrated). ```bash pnpm --filter server migration:create --name=my_change # new empty migration pnpm --filter server migration:latest # apply all pending