Is there a need to put my migration within an transaction between `BEGIN;` / `COMMIT;` statements.

I ask as I do and that works fine when I just put 1 transaction though when I had a fairly large migration recently when testing locally I had 3 transactions and I did neglect to change it back to just 1. It was fine locally when starting supabase after an supabase stop --no-backup though when we merged it in and deployed the 2nd and 3rd transactions were not applied.

It is not ideal that it behaves differently locally using supabase cli and when finally deploying! Or should I just not use any BEGIN; / COMMIT; statements in future at all so I don't make this mistake again.

Edit: added detail.
Was this page helpful?