Review PostgreSQL schema, migrations, and SQL queries for good practices. Use when auditing data types, primary/foreign keys, indexes, SELECT * usage, parameterized queries, Liquibase migration patterns, or snake_case naming conventions.
Apply this skill to Liquibase changelogs, SQL migration files, and MyBatis mapper XML/annotation query files.
backend/src/main/resources/db/backend/src/main/resources/db/mapper/ (or bin/main/db/mapper/)backend/src/main/java/**/db/| Severity | file/path | description of issue | concrete suggestion || Severity | Meaning |
|---|---|
| High | Missing constraint, unsafe SQL, or data type that causes silent data loss |
| Medium | Missing index on filtered/joined column, or VARCHAR without length |
| Low | Naming convention deviation or minor schema style issue |
SELECT * — always list columns explicitlyVARCHAR without a length — prefer TEXTTIMESTAMP without time zone — prefer TIMESTAMPTZNOT NULL where null values are nonsensical