1
0
Fork 0

docs: require named migrations in AGENTS.md

Add a Database section rule to always create migrations with
'payload migrate:create <name>' so migration history stays
auditable (timestamp-only filenames obscure destructive steps
like DROP COLUMN during data-loss review).
This commit is contained in:
Jason Fraley 2026-09-06 01:28:27 -04:00
parent bcd6d97ff4
commit 49bffc04a5

View file

@ -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. 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 <name>` (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 ## Code style
- **Prettier**: double quotes, trailing commas (all), 100 char print width, semicolons. - **Prettier**: double quotes, trailing commas (all), 100 char print width, semicolons.