Database / Supabase Intermediate to Advanced Interview Questions
Which is better for production schema changes, editing directly in Studio or CLI-managed migrations, and why?
For anything beyond a quick, one-off inspection or an emergency fix, CLI-managed migrations are the better choice for production, because they turn a schema change into an artifact that can be reviewed, tested against a preview branch, and applied identically and repeatably across every environment — the same properties that make version-controlled application code safer than editing files directly on a production server.
Editing directly in Studio's SQL editor against production has a real place: diagnosing an incident with read queries, or a genuinely urgent one-line fix when going through a full PR-and-CI cycle would take too long relative to the cost of continued downtime. Even then, the discipline that keeps this safe is treating it as an exception rather than the norm — retroactively capturing whatever was changed as a proper migration file afterward, so the change isn't silently lost the next time someone runs supabase db push against a fresh environment or a teammate wonders why staging and production have quietly diverged.
The honest answer, then, is CLI-managed migrations as the default and Studio edits as a deliberate, logged exception — not a permanent alternative workflow running alongside it.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
