Does Netlify’s rollback automatically revert external database schema changes?
0 reputation · 09 Aug 2021, 11:24 UTC
Goal: Determine whether a Netlify production rollback can safely revert an external database schema that was altered by a serverless function during the original deploy, so that the rolled‑back code and the database remain compatible without manual intervention.
Constraints: Netlify treats each deploy as an immutable snapshot; rolling back restores only the code, functions and static assets, leaving any schema changes made to an external database untouched. Because Netlify does not provide built‑in migration management or a rollback hook that invokes a down migration, developers must rely on their own tooling (e.g., Prisma, TypeORM) to compensate, and it is unclear if any configuration or feature can automate this safety net.
Can Netlify be configured to trigger a down migration automatically when a rollback occurs? Does Netlify provide an event or API that allows a migration tool to run compensating scripts during a rollback? Which existing Netlify features, if any, could be combined to achieve schema‑safe rollbacks without manual steps?