Skip to main content

max / makenotwork

2.5 KB · 57 lines History Blame Raw
1 -- Platform seed data: tag taxonomy and project categories.
2 -- These are structural data the application needs to function.
3
4 -- ============================================================================
5 -- Tag Taxonomy
6 -- ============================================================================
7
8 -- Top-level categories
9 INSERT INTO tags (name, slug, parent_id, sort_order) VALUES
10 ('Writing', 'writing', NULL, 0),
11 ('Audio', 'audio', NULL, 1),
12 ('Software', 'software', NULL, 2),
13 ('Topics', 'topics', NULL, 3);
14
15 -- Writing children
16 INSERT INTO tags (name, slug, parent_id, sort_order) VALUES
17 ('Essays', 'essays', (SELECT id FROM tags WHERE slug = 'writing'), 0),
18 ('Book', 'book', (SELECT id FROM tags WHERE slug = 'writing'), 1),
19 ('Preview', 'preview', (SELECT id FROM tags WHERE slug = 'writing'), 2),
20 ('Newsletter', 'newsletter', (SELECT id FROM tags WHERE slug = 'writing'), 3);
21
22 -- Audio children
23 INSERT INTO tags (name, slug, parent_id, sort_order) VALUES
24 ('Podcast', 'podcast', (SELECT id FROM tags WHERE slug = 'audio'), 0),
25 ('Interviews', 'interviews', (SELECT id FROM tags WHERE slug = 'audio'), 1),
26 ('Music', 'music', (SELECT id FROM tags WHERE slug = 'audio'), 2);
27
28 -- Software children
29 INSERT INTO tags (name, slug, parent_id, sort_order) VALUES
30 ('Plugin', 'plugin', (SELECT id FROM tags WHERE slug = 'software'), 0),
31 ('App', 'app', (SELECT id FROM tags WHERE slug = 'software'), 1),
32 ('Game', 'game', (SELECT id FROM tags WHERE slug = 'software'), 2);
33
34 -- Topics children
35 INSERT INTO tags (name, slug, parent_id, sort_order) VALUES
36 ('Productivity', 'productivity', (SELECT id FROM tags WHERE slug = 'topics'), 0),
37 ('Creativity', 'creativity', (SELECT id FROM tags WHERE slug = 'topics'), 1),
38 ('Philosophy', 'philosophy', (SELECT id FROM tags WHERE slug = 'topics'), 2);
39
40 -- ============================================================================
41 -- Project Categories
42 -- ============================================================================
43
44 INSERT INTO project_categories (name, slug) VALUES
45 ('Music', 'music'),
46 ('Band', 'band'),
47 ('Podcast', 'podcast'),
48 ('Blog', 'blog'),
49 ('Software', 'software'),
50 ('Art', 'art'),
51 ('Video', 'video'),
52 ('Writing', 'writing'),
53 ('Photography', 'photography'),
54 ('Education', 'education'),
55 ('Games', 'games'),
56 ('Comics', 'comics');
57