Skip to content

Commit 4e6f48d

Browse files
authored
chore(supabase): add seed data to test the onboarding flow (#5160)
1 parent 9e85f54 commit 4e6f48d

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

apps/frontend/supabase/seed.sql

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
-- Upsert the test user to avoid errors on re-running the seed
2+
INSERT INTO
3+
auth.users (
4+
instance_id,
5+
id,
6+
aud,
7+
role,
8+
email,
9+
encrypted_password,
10+
email_confirmed_at,
11+
recovery_sent_at,
12+
last_sign_in_at,
13+
raw_app_meta_data,
14+
raw_user_meta_data,
15+
created_at,
16+
updated_at,
17+
confirmation_token,
18+
email_change,
19+
email_change_token_new,
20+
recovery_token
21+
)
22+
VALUES
23+
(
24+
'00000000-0000-0000-0000-000000000000',
25+
uuid_generate_v4 (),
26+
'authenticated',
27+
'authenticated',
28+
29+
crypt ('password123', gen_salt ('bf')),
30+
current_timestamp,
31+
current_timestamp,
32+
current_timestamp,
33+
'{"provider":"email","providers":["email"]}',
34+
'{"name":"Test User"}',
35+
current_timestamp,
36+
current_timestamp,
37+
'',
38+
'',
39+
'',
40+
''
41+
);
42+
43+
INSERT INTO organizations (created_by, org_name)
44+
VALUES ((SELECT id FROM auth.users WHERE email = '[email protected]' LIMIT 1), 'oso');
45+
46+
INSERT INTO notebooks (org_id, created_by, notebook_name, data)
47+
VALUES
48+
((SELECT id FROM organizations WHERE org_name = 'oso' LIMIT 1), (SELECT id FROM auth.users WHERE email = '[email protected]' LIMIT 1), 'template-data-is-beautiful', '{"cells":[{"id":"1","type":"python","content":"print(\"Hello from data-is-beautiful notebook!\")"}]}'),
49+
((SELECT id FROM organizations WHERE org_name = 'oso' LIMIT 1), (SELECT id FROM auth.users WHERE email = '[email protected]' LIMIT 1), 'template-leaderboard', '{"cells":[{"id":"1","type":"python","content":"print(\"Hello from leaderboard notebook!\")"}]}'),
50+
((SELECT id FROM organizations WHERE org_name = 'oso' LIMIT 1), (SELECT id FROM auth.users WHERE email = '[email protected]' LIMIT 1), 'template-value-chain', '{"cells":[{"id":"1","type":"python","content":"print(\"Hello from value-chain notebook!\")"}]}');
51+
52+
INSERT INTO resource_permissions (permission_level, notebook_id) SELECT 'read', id FROM notebooks;

0 commit comments

Comments
 (0)