© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•2w ago•
2 replies
Míša 🌱

Local `db reset` & seeds with RLS

authCLI
The goal: I want to have one command to reset local supabase instance, run migrations and seed populate the database.
Note: This has to be one command (script is ok) that resets everything to "initial" state without any further manual steps so that I can imediatelly log-in to my app using known credentials.
The idea: Let's just use
supabase db reset
supabase db reset

The problem: I'm using row level security (RLS) like
(owner_id = auth.uid())
(owner_id = auth.uid())
so I need to fill in
owner_id
owner_id
with valid user. I can create the user in the first step of seeding via something like
INSERT INTO auth.users (id, email, raw_user_meta_data, created_at) VALUES ( '25d62eed-4b9f-43cc-b942-6c433ac683a6'::uuid, 'john@example.com [blocked]', '{"email_confirmed": true}'::jsonb, now() );
INSERT INTO auth.users (id, email, raw_user_meta_data, created_at) VALUES ( '25d62eed-4b9f-43cc-b942-6c433ac683a6'::uuid, 'john@example.com [blocked]', '{"email_confirmed": true}'::jsonb, now() );
, and then use that record. But to my best knowledge it's not possible to set the password for such user.

What I tried: I could run
supabase db reset --no-seed
supabase db reset --no-seed
, then have a JS script that calls
supabase.auth.signUp({ email: ..., password: ... })
supabase.auth.signUp({ email: ..., password: ... })
, but then (to my best knowledge) there is no command to just run the seeds and I would have to do that manually. Which is possible, but ...
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

sync local db with remote db
SupabaseSSupabase / help-and-questions
2d ago
Remote DB Reset
SupabaseSSupabase / help-and-questions
4y ago
Reset local Supabase instance?
SupabaseSSupabase / help-and-questions
4y ago
supabase db reset: problems with pg_cron
SupabaseSSupabase / help-and-questions
14mo ago