S
Supabase2mo ago
Conch

Local Migrations Don't Copy Database Roles

I'm trying to set up local Supabase for testing. I use a tool called PowerSync which requires its own powersync_role role. I'm trying to copy my schema from my linked cloud database to my local one, but the migration tries to apply rules set for the powersync_role without actually creating the role, so the migration fails. Am I doing something wrong? How do I fix this?
7 Replies
garyaustin
garyaustin2mo ago
Not completely familiar with this but I know the roles are a special case. There are several role flags for CLI things... https://supabase.com/docs/reference/cli/supabase-db-push
garyaustin
garyaustin2mo ago
No description
Conch
ConchOP2mo ago
It looks like that's for db push. I'm trying to copy cloud schema to my local environment, which uses db pull. It doesn't seem to have that flag
garyaustin
garyaustin2mo ago
Not really sure, but I think they have to be handled specially in roles.sql. https://supabase.com/docs/reference/cli/supabase-db-dump
Conch
ConchOP2mo ago
Great, I noticed one of the commands referenced a roles.sql. It looks like that's what I needed to do, thank you I'm now getting an error running db diff about it not being able to reach my database, but I'm sure that's a different issue
garyaustin
garyaustin2mo ago
And, I won't be much help as I don't use this. I'd start a new topic if you have more and I'll let others answer even if not tonight.
Conch
ConchOP2mo ago
Right, thank you for your help

Did you find this page helpful?