Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview Updates Reviewed by Cursor Bugbot for commit 41a1b50. Configure here. |
Greptile SummaryThis PR makes two targeted improvements to the migration infrastructure: it moves the Confidence Score: 5/5Safe to merge — both changes are correct, well-documented, and idempotent. The SQL reordering fixes a real constraint-violation bug that would have caused migration 0194 to fail on databases with multi-workspace users; the DROP INDEX IF EXISTS is idempotent so re-runs are safe. The printMigrationError function is purely additive, handles all error shapes defensively, and the function declaration is correctly hoisted in the ES module scope. No P0/P1 findings. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Script as migrate.ts
participant Drizzle as drizzle-orm migrator
participant PG as PostgreSQL
Script->>Drizzle: migrate(drizzle(client), { migrationsFolder })
Drizzle->>PG: Run migration SQL statements
alt Migration succeeds
PG-->>Drizzle: OK
Drizzle-->>Script: resolved
Script->>Script: console.log("Migrations applied successfully.")
else Migration fails
PG-->>Drizzle: PostgresError (code, constraint, hint, query…)
Drizzle-->>Script: throws Error
Script->>Script: printMigrationError(error)
Note over Script: Logs message, PG fields (code,<br/>constraint, hint, table, etc.),<br/>failing query, parameters,<br/>cause chain, stack
Script->>Script: process.exit(1)
end
Script->>PG: client.end() [finally]
Reviews (1): Last reviewed commit: "improvement(migrations): log better erro..." | Re-trigger Greptile |
improvement(migrations): log better errors (#4260)