Skip to main content

max / makenotwork

8.5 KB · 244 lines History Blame Raw
1 -- Demo Data Seed Script
2 -- Run with: psql $DATABASE_URL -f seed_demo.sql
3 -- Can be safely re-run (uses ON CONFLICT DO UPDATE to ensure data is current)
4
5 -- ============================================================================
6 -- USER: Elena Vasquez
7 -- ============================================================================
8 -- Password: demo123
9 -- Hash generated with Argon2 default settings
10 INSERT INTO users (
11 id,
12 username,
13 email,
14 password_hash,
15 display_name,
16 bio,
17 stripe_account_id,
18 stripe_onboarding_complete,
19 stripe_payouts_enabled,
20 stripe_charges_enabled
21 ) VALUES (
22 '11111111-1111-1111-1111-111111111111',
23 'elena',
24 'elena@example.com',
25 '$argon2id$v=19$m=19456,t=2,p=1$DKKe+bI4TwiyxkLgyCDZMA$oXVcdLHZIxv1hkFGK4JB5HNqoGURavSXhY9gjmvQeEM',
26 'Elena Vasquez',
27 'Writer and researcher exploring the intersection of creativity, technology, and human flourishing. Author of Slow Craft and the Patterns newsletter.',
28 'acct_demo_elena',
29 true,
30 true,
31 true
32 ) ON CONFLICT (username) DO UPDATE SET
33 email = EXCLUDED.email,
34 password_hash = EXCLUDED.password_hash,
35 display_name = EXCLUDED.display_name,
36 bio = EXCLUDED.bio,
37 stripe_account_id = EXCLUDED.stripe_account_id,
38 stripe_onboarding_complete = EXCLUDED.stripe_onboarding_complete,
39 stripe_payouts_enabled = EXCLUDED.stripe_payouts_enabled,
40 stripe_charges_enabled = EXCLUDED.stripe_charges_enabled;
41
42 -- ============================================================================
43 -- PROJECT 1: Patterns Newsletter (Writing)
44 -- ============================================================================
45 INSERT INTO projects (
46 id,
47 user_id,
48 slug,
49 title,
50 description,
51 project_type,
52 is_public
53 ) VALUES (
54 '22222222-2222-2222-2222-222222222221',
55 '11111111-1111-1111-1111-111111111111',
56 'patterns-newsletter',
57 'Patterns',
58 'Essays on productivity, creativity, and intentional living.',
59 'writing',
60 true
61 ) ON CONFLICT (user_id, slug) DO UPDATE SET
62 title = EXCLUDED.title,
63 description = EXCLUDED.description,
64 project_type = EXCLUDED.project_type,
65 is_public = EXCLUDED.is_public;
66
67 -- Items for Patterns Newsletter
68 INSERT INTO items (id, project_id, title, description, price_cents, item_type, is_public, sort_order, tags) VALUES
69 (
70 '33333333-3333-3333-3333-333333333331',
71 '22222222-2222-2222-2222-222222222221',
72 'The Art of Doing Less',
73 'An essay exploring why our obsession with productivity often undermines the very outcomes we seek. Drawing on research in cognitive science and philosophy, this piece argues for a more intentional approach to work and rest.',
74 500,
75 'text',
76 true,
77 1,
78 '["Essays", "Productivity", "Creativity", "Philosophy"]'
79 ),
80 (
81 '33333333-3333-3333-3333-333333333332',
82 '22222222-2222-2222-2222-222222222221',
83 'Finding Your Own Rhythm',
84 'Not everyone thrives on the same schedule. This essay examines how to discover your natural working patterns and structure your days around them, rather than forcing yourself into someone else''s ideal routine.',
85 500,
86 'text',
87 true,
88 2,
89 '["Essays", "Productivity"]'
90 ),
91 (
92 '33333333-3333-3333-3333-333333333333',
93 '22222222-2222-2222-2222-222222222221',
94 'The Productivity Paradox',
95 'A free introduction to the themes explored throughout the Patterns newsletter. Why do we feel busier than ever while accomplishing less of what matters?',
96 0,
97 'text',
98 true,
99 3,
100 '["Essays", "Productivity"]'
101 )
102 ON CONFLICT (id) DO UPDATE SET
103 title = EXCLUDED.title,
104 description = EXCLUDED.description,
105 price_cents = EXCLUDED.price_cents,
106 item_type = EXCLUDED.item_type,
107 is_public = EXCLUDED.is_public,
108 sort_order = EXCLUDED.sort_order,
109 tags = EXCLUDED.tags;
110
111 -- ============================================================================
112 -- PROJECT 2: Patterns Podcast
113 -- ============================================================================
114 INSERT INTO projects (
115 id,
116 user_id,
117 slug,
118 title,
119 description,
120 project_type,
121 is_public
122 ) VALUES (
123 '22222222-2222-2222-2222-222222222222',
124 '11111111-1111-1111-1111-111111111111',
125 'patterns-podcast',
126 'Patterns Podcast',
127 'Conversations about creativity, rest, and meaningful work.',
128 'podcast',
129 true
130 ) ON CONFLICT (user_id, slug) DO UPDATE SET
131 title = EXCLUDED.title,
132 description = EXCLUDED.description,
133 project_type = EXCLUDED.project_type,
134 is_public = EXCLUDED.is_public;
135
136 -- Items for Patterns Podcast
137 INSERT INTO items (id, project_id, title, description, price_cents, item_type, is_public, sort_order, tags) VALUES
138 (
139 '33333333-3333-3333-3333-333333333341',
140 '22222222-2222-2222-2222-222222222222',
141 'Episode 12: The Space Between Tasks',
142 'A conversation with cognitive scientist Dr. Maya Chen about the importance of transition time between activities. We explore how the moments of apparent idleness are often when our best thinking happens.',
143 300,
144 'audio',
145 true,
146 1,
147 '["Podcast", "Productivity", "Creativity", "Interviews"]'
148 ),
149 (
150 '33333333-3333-3333-3333-333333333342',
151 '22222222-2222-2222-2222-222222222222',
152 'Episode 11: Creative Incubation',
153 'What happens in your brain when you step away from a problem? This episode dives into the science of incubation and why your best ideas often come in the shower.',
154 300,
155 'audio',
156 true,
157 2,
158 '["Podcast", "Creativity"]'
159 ),
160 (
161 '33333333-3333-3333-3333-333333333343',
162 '22222222-2222-2222-2222-222222222222',
163 'Episode 10: The Neuroscience of Rest',
164 'A free episode featuring neuroscientist Dr. James Park discussing why rest is not the opposite of productivity but its essential complement.',
165 0,
166 'audio',
167 true,
168 3,
169 '["Podcast", "Interviews"]'
170 )
171 ON CONFLICT (id) DO UPDATE SET
172 title = EXCLUDED.title,
173 description = EXCLUDED.description,
174 price_cents = EXCLUDED.price_cents,
175 item_type = EXCLUDED.item_type,
176 is_public = EXCLUDED.is_public,
177 sort_order = EXCLUDED.sort_order,
178 tags = EXCLUDED.tags;
179
180 -- ============================================================================
181 -- PROJECT 3: Slow Craft (Book)
182 -- ============================================================================
183 INSERT INTO projects (
184 id,
185 user_id,
186 slug,
187 title,
188 description,
189 project_type,
190 is_public
191 ) VALUES (
192 '22222222-2222-2222-2222-222222222223',
193 '11111111-1111-1111-1111-111111111111',
194 'slow-craft',
195 'Slow Craft',
196 'A guide to sustainable creativity and meaningful work.',
197 'book',
198 true
199 ) ON CONFLICT (user_id, slug) DO UPDATE SET
200 title = EXCLUDED.title,
201 description = EXCLUDED.description,
202 project_type = EXCLUDED.project_type,
203 is_public = EXCLUDED.is_public;
204
205 -- Items for Slow Craft
206 INSERT INTO items (id, project_id, title, description, price_cents, item_type, is_public, sort_order, tags) VALUES
207 (
208 '33333333-3333-3333-3333-333333333351',
209 '22222222-2222-2222-2222-222222222223',
210 'Slow Craft: Complete Book',
211 'The complete guide to building a sustainable creative practice. Across 12 chapters, explore how to do your best work without burning out, cultivate deep focus in an age of distraction, and create work that matters on your own terms.',
212 1500,
213 'text',
214 true,
215 1,
216 '["Book", "Creativity"]'
217 ),
218 (
219 '33333333-3333-3333-3333-333333333352',
220 '22222222-2222-2222-2222-222222222223',
221 'Chapter 1: Introduction (Preview)',
222 'A free preview of Slow Craft. This opening chapter introduces the core philosophy of the book and sets the stage for the practices that follow.',
223 0,
224 'text',
225 true,
226 2,
227 '["Book", "Preview"]'
228 )
229 ON CONFLICT (id) DO UPDATE SET
230 title = EXCLUDED.title,
231 description = EXCLUDED.description,
232 price_cents = EXCLUDED.price_cents,
233 item_type = EXCLUDED.item_type,
234 is_public = EXCLUDED.is_public,
235 sort_order = EXCLUDED.sort_order,
236 tags = EXCLUDED.tags;
237
238 -- ============================================================================
239 -- Verification (shows what was seeded)
240 -- ============================================================================
241 SELECT 'Seeded user:' as status, username, email FROM users WHERE username = 'elena';
242 SELECT 'Seeded projects:' as status, count(*) as count FROM projects WHERE user_id = (SELECT id FROM users WHERE username = 'elena');
243 SELECT 'Seeded items:' as status, count(*) as count FROM items WHERE project_id IN (SELECT id FROM projects WHERE user_id = (SELECT id FROM users WHERE username = 'elena'));
244