Skip to content

Instantly share code, notes, and snippets.

@itz4blitz
Last active May 18, 2025 02:32
Show Gist options
  • Select an option

  • Save itz4blitz/a5001f3f0576ff8995d43f59f7918b65 to your computer and use it in GitHub Desktop.

Select an option

Save itz4blitz/a5001f3f0576ff8995d43f59f7918b65 to your computer and use it in GitHub Desktop.

Revisions

  1. itz4blitz revised this gist May 18, 2025. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions seed_users.sql
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,9 @@
    INSERT INTO auth.users ( instance_id, id, aud, role, email, encrypted_password, email_confirmed_at, recovery_sent_at, last_sign_in_at, raw_app_meta_data, raw_user_meta_data, created_at, updated_at, confirmation_token, email_change, email_change_token_new, recovery_token)
    VALUES
    ('00000000-0000-0000-0000-000000000000', uuid_generate_v4(), 'authenticated', 'authenticated', 'insiders@grida.co', crypt('password', gen_salt('bf')), current_timestamp, current_timestamp, current_timestamp, '{"provider":"email","providers":["email"]}', '{}', current_timestamp, current_timestamp, '', '', '', '');
    ('00000000-0000-0000-0000-000000000000', uuid_generate_v4(), 'authenticated', 'authenticated', 'email@example.com', crypt('password', gen_salt('bf')), current_timestamp, current_timestamp, current_timestamp, '{"provider":"email","providers":["email"]}', '{}', current_timestamp, current_timestamp, '', '', '', '');


    -- test user email identity
    INSERT INTO auth.identities (id, user_id, identity_data, provider, provider_id, last_sign_in_at, created_at, updated_at)
    VALUES
    (uuid_generate_v4(), (SELECT id FROM auth.users WHERE email = 'insiders@grida.co'), format('{"sub":"%s","email":"%s"}', (SELECT id FROM auth.users WHERE email = 'insiders@grida.co')::text, 'insiders@grida.co')::jsonb, 'email', uuid_generate_v4(), current_timestamp, current_timestamp, current_timestamp);
    (uuid_generate_v4(), (SELECT id FROM auth.users WHERE email = 'email@example.com'), format('{"sub":"%s","email":"%s"}', (SELECT id FROM auth.users WHERE email = 'insiders@grida.co')::text, 'insiders@grida.co')::jsonb, 'email', uuid_generate_v4(), current_timestamp, current_timestamp, current_timestamp);
  2. itz4blitz created this gist May 18, 2025.
    9 changes: 9 additions & 0 deletions seed_users.sql
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    INSERT INTO auth.users ( instance_id, id, aud, role, email, encrypted_password, email_confirmed_at, recovery_sent_at, last_sign_in_at, raw_app_meta_data, raw_user_meta_data, created_at, updated_at, confirmation_token, email_change, email_change_token_new, recovery_token)
    VALUES
    ('00000000-0000-0000-0000-000000000000', uuid_generate_v4(), 'authenticated', 'authenticated', 'insiders@grida.co', crypt('password', gen_salt('bf')), current_timestamp, current_timestamp, current_timestamp, '{"provider":"email","providers":["email"]}', '{}', current_timestamp, current_timestamp, '', '', '', '');


    -- test user email identity
    INSERT INTO auth.identities (id, user_id, identity_data, provider, provider_id, last_sign_in_at, created_at, updated_at)
    VALUES
    (uuid_generate_v4(), (SELECT id FROM auth.users WHERE email = 'insiders@grida.co'), format('{"sub":"%s","email":"%s"}', (SELECT id FROM auth.users WHERE email = 'insiders@grida.co')::text, 'insiders@grida.co')::jsonb, 'email', uuid_generate_v4(), current_timestamp, current_timestamp, current_timestamp);