Library › Coding AI › Software developers
Review a migration with one MUST, one SHOULD and one NIT
Practice: Asking for a format you can use. About 5 minutes.
About this exercise
Review this Postgres 16 migration as exactly 3 numbered comments: one 'MUST (L<n>): ...', then one 'SHOULD (L<n>): ...', then one 'NIT (L<n>): ...', each under 25 words. Team rule: anything that blocks writes on a table over 1 million rows is a MUST. Don't flag the ADD COLUMN with a constant DEFAULT; on Postgres 11+ it doesn't rewrite the table. No code blocks, no summary.
Common mistakes when you ask AI for this
- No severity labels. Without your scheme, the AI writes a flat list where nothing says what blocks the merge. Try: Show the shape: "1. MUST (L5): ... 2. SHOULD (L9): ... 3. NIT (L2): ...".
- Flagging a non-issue. The AI often warns that ADD COLUMN with DEFAULT rewrites the table, which stopped being true in Postgres 11. Try: Add: "Postgres 16. Don't flag the ADD COLUMN DEFAULT on line 3."
- Wrong priority. Without your rule, the AI may rank the missing down migration above a write-blocking index. Try: Add: "Anything that blocks writes on a table over 1M rows is a MUST."
- A long review with fixes. The AI lists 6 or more points and pastes rewritten SQL. Try: Add: "Exactly 3 numbered comments under 25 words each. No code blocks."
What a strong prompt includes
- Gives the labels
- Asks for line numbers
- Gives the priority rule
- Names the Postgres version
- Sets the number of comments
Related exercises
- Add a cron line that matches the others in a crontab (Coding AI · Product managers)
- Add dark mode by overriding your existing CSS variables (Coding AI · Software developers)
- Add input checks to your number guessing game (Coding AI · High school students)
- Add input validation to a Java method with exact messages (Coding AI · Software developers)
- Add labels to a signup form without rewriting the page (Coding AI · High school students)