From 49bffc04a524bd041820347f89285091e0d3e60b Mon Sep 17 00:00:00 2001 From: Z8MB1E Date: Sun, 6 Sep 2026 01:28:27 -0400 Subject: [PATCH] docs: require named migrations in AGENTS.md Add a Database section rule to always create migrations with 'payload migrate:create ' so migration history stays auditable (timestamp-only filenames obscure destructive steps like DROP COLUMN during data-loss review). --- AGENTS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 8b2c598..5dcd9f6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -299,6 +299,8 @@ PostgreSQL via `@payloadcms/db-postgres`. Schema defined in `src/payload-generat In development, `postgresAdapter` uses `push: false` — run `bun run payload migrate` after schema changes to apply them locally. +**Always name your migrations**: create them with `bun run payload migrate:create ` (snake_case, e.g. `migrate:create add_evaluation_reminders_field`), never bare `migrate:create`. Unnamed migrations get timestamp-only filenames (`20260905_213824.ts`) that say nothing about what they do — several older migrations suffer from this and it makes the migration history and rollback auditing (data-loss review of `DROP COLUMN`/`DROP TABLE` steps) much harder than it needs to be. Named example: `20260906_050900_add_evaluation_reminders_field.ts`. + ## Code style - **Prettier**: double quotes, trailing commas (all), 100 char print width, semicolons.