ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabaseโ€ข4y agoโ€ข
4 replies
chrisgrabinski

[solved] Generating users in seed.sql

Hi folks,

I would like to generate a handful of users + public profiles in my local dev environment but I can't get it to work. I found some docs and GitHub discussions around the topic but it didn't help me solve the problem.

Ultimately, I created a user in the UI and logged in, to see which columns in the
auth.users
auth.users
table will be filled. I then used this information in my
seed.sql
seed.sql
file. And while the users are actually showing up in the UI, when trying to log in (or sending a magic link from Studio), I am getting an
Database error finding user
Database error finding user
/
Failed to send magic link: Database error finding user
Failed to send magic link: Database error finding user
error.

Here's a snippet from my
seed.sql
seed.sql
:

insert into auth.users (email, id, instance_id, aud, role, encrypted_password, invited_at, confirmation_sent_at, last_sign_in_at, raw_app_meta_data, raw_user_meta_data, created_at, updated_at, email_confirmed_at, email_change_confirm_status)
values
  ('user-1@example.com', 'bd59c1b6-949a-44fb-b0e1-fac10f7367a1', '00000000-0000-0000-0000-000000000000', 'authenticated', 'authenticated', '$2a$10$jFOTJvSGDgj5ImgfH3DLeezIZY6HOayJvlE80lY0VdVfdY.zo3h7u', now(), now(), now(), '{"provider":"email","providers":["email"]}', '{}', now(), now(), now(), 0),
  ('user-2@example.com', 'bd59c1b6-949a-44fb-b0e1-fac10f7367a2', '00000000-0000-0000-0000-000000000000', 'authenticated', 'authenticated', '$2a$10$jFOTJvSGDgj5ImgfH3DLeezIZY6HOayJvlE80lY0VdVfdY.zo3h7u', now(), now(), now(), '{"provider":"email","providers":["email"]}', '{}', now(), now(), now(), 0);
insert into auth.users (email, id, instance_id, aud, role, encrypted_password, invited_at, confirmation_sent_at, last_sign_in_at, raw_app_meta_data, raw_user_meta_data, created_at, updated_at, email_confirmed_at, email_change_confirm_status)
values
  ('user-1@example.com', 'bd59c1b6-949a-44fb-b0e1-fac10f7367a1', '00000000-0000-0000-0000-000000000000', 'authenticated', 'authenticated', '$2a$10$jFOTJvSGDgj5ImgfH3DLeezIZY6HOayJvlE80lY0VdVfdY.zo3h7u', now(), now(), now(), '{"provider":"email","providers":["email"]}', '{}', now(), now(), now(), 0),
  ('user-2@example.com', 'bd59c1b6-949a-44fb-b0e1-fac10f7367a2', '00000000-0000-0000-0000-000000000000', 'authenticated', 'authenticated', '$2a$10$jFOTJvSGDgj5ImgfH3DLeezIZY6HOayJvlE80lY0VdVfdY.zo3h7u', now(), now(), now(), '{"provider":"email","providers":["email"]}', '{}', now(), now(), now(), 0);


Am I missing something, or am I approaching this incorrectly?
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
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Seed database with users
SupabaseSSupabase / help-and-questions
14mo ago
Inserting dummy data from seed.sql
SupabaseSSupabase / help-and-questions
4y ago
Error Can't process file in supabasemigrations seed.sql
SupabaseSSupabase / help-and-questions
4y ago
Using vault for generating users encryption keys
SupabaseSSupabase / help-and-questions
6mo ago