© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•6mo ago
scottynomad

Branch migrations that depend on roles.sql fail.

Hi! Recently my branches started failing to start up because they contain migrations with GRANT statements for a custom role I use. With the recently auth changes I was no longer able to create that role in a migration so I moved it to roles.sql. I thought that worked for a awhile but now the migrations are failing because that role has not yet been created.

So, my question really is, what's the right way to deal with custom roles in branches and is my assumption correct that
roles.sql
roles.sql
should be applied prior to the migrations during branch boostrapping?

One other fact I can add is that this all seems to work as expected in a local dev environment when running
supabase db reset
supabase db reset
.

Thanks!
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Migrations fail without feedback
SupabaseSSupabase / help-and-questions
4y ago
Automate SQL Migrations based on local seed script
SupabaseSSupabase / help-and-questions
4y ago
Creating a DB branch with Developer roles
SupabaseSSupabase / help-and-questions
7mo ago
Local Migrations Don't Copy Database Roles
SupabaseSSupabase / help-and-questions
5mo ago