|
| 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