171
Rollback ("down") Migrations
Source: supabase/supabase#11263 · opened by @itsmingjie
Hi all! I've been using Hasura for my company's codebase but am interested in learning more about how Supabase works.
I'm trying to set up migrations, and after following the guide included in the Supabase CLI [blog post]( I was able to get a forward migration working. But I'm curious whether there is a way perform a migration "rollback"? Use case: developer A and developer B are working on two sibling branches, so when merging their branches it might be helpful to roll back applied migrations to resolve potential conflicts.
Hasura generates an up.sql and down.sql for each migration, and you can run hasura migrate apply --down 2 or hasura migrate apply --up 1 to move your database schema forward or backward in time. Is there a similar implementation that I'm missing for Supabase?
Hasura doc for rolling back migrations:
I'm trying to set up migrations, and after following the guide included in the Supabase CLI [blog post]( I was able to get a forward migration working. But I'm curious whether there is a way perform a migration "rollback"? Use case: developer A and developer B are working on two sibling branches, so when merging their branches it might be helpful to roll back applied migrations to resolve potential conflicts.
Hasura generates an up.sql and down.sql for each migration, and you can run hasura migrate apply --down 2 or hasura migrate apply --up 1 to move your database schema forward or backward in time. Is there a similar implementation that I'm missing for Supabase?
Hasura doc for rolling back migrations:
No pledges yet. Be the first to back this.
Comments
Similar requests
Support for versioned subfolders in migrations
2 votes · 0 comments
an way to reset/rollback project database to the first version
11 votes · 0 comments
Allow Customization of /migrations Directory in config.toml for Supabase Migrations and Shadow Database
7 votes · 0 comments
Supabase MCP Server for local development use
2 votes · 0 comments
Restrict database schema changes in web UI
13 votes · 0 comments
No comments yet.