-
Notifications
You must be signed in to change notification settings - Fork 1
/
data_inserts.sql
112 lines (89 loc) · 4.41 KB
/
data_inserts.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/************************************************************
INSERT users
*************************************************************/
INSERT INTO users (email, username, password)
VALUES ('[email protected]', 'joe_39939', '9e93i3j88d'),
('[email protected]', 'jane_773', 'k29w7h347e'),
('[email protected]', 'bill_029', 'i782hbf67g'),
('[email protected]', 'sue_54351', '.3;3;30877'),
('[email protected]', 'ted_23423', ';po09ioo99'),
('[email protected]', 'tim987989', '0aao0rg9ki'),
('[email protected]', 'frank_0', 'i782hbf67g'),
('[email protected]', 'sheryl', '.3;3;30877'),
('[email protected]', 'alice44', ';po09ioo99'),
('[email protected]', 'jim980089', '0aao0rg9ki');
/************************************************************
INSERT vehicles
*************************************************************/
INSERT INTO vehicles (year, make, model, engine)
VALUES (1996, 'Ford', 'Taurus', '3.0L'),
(2000, 'Honda', 'S2000', '2.0L'),
(1957, 'Chevrolet', 'Bel Air', '5.7L'),
(2006, 'BMW', '330xi', '3.0L'),
(2020, 'Nissan', 'Altima', '2.4L'),
(2003, 'Mercury', 'Cougar', '2.5L'),
(2011, 'Toyota', 'Tacoma', '4.0L'),
(2019, 'Chrysler', '300', '3.5L'),
(1999, 'Plymouth', 'Voyager', '3.3L'),
(2000, 'Mercedes-Benz', 'E320', '3.2L');
/************************************************************
INSERT posts
*************************************************************/
INSERT INTO posts (title, repair_steps, user_id, vehicle_id)
VALUES ('Auxiliary Cooling Fan', '[{"test":"testing"}]', 1, 1),
('Alternator', '[{"test":"testing"}]', 2, 2),
('Starter', '[{"test":"testing"}]', 3, 3),
('Radiator', '[{"test":"testing"}]', 4, 4),
('Oil Change', '[{"test":"testing"}]', 5, 5),
('Drive Belt', '[{"test":"testing"}]', 6, 6),
('Intake Manifold', '[{"test":"testing"}]', 7, 7),
('Engine Mounts', '[{"test":"testing"}]', 8, 8),
('Front Brakes', '[{"test":"testing"}]', 9, 9),
('Tail Light Bulb', '[{"test":"testing"}]', 10, 10);
/************************************************************
INSERT: tags
*************************************************************/
INSERT INTO tags (tag) VALUES ('alternator') ON CONFLICT DO NOTHING;
INSERT INTO posts_tags (post_id, tag_id) VALUES (11,
(SELECT id FROM tags WHERE tag = 'alternator'));
INSERT INTO tags (tag) VALUES ('90A') ON CONFLICT DO NOTHING;
INSERT INTO posts_tags (post_id, tag_id) VALUES (12,
(SELECT id FROM tags WHERE tag = '90A'));
INSERT INTO tags (tag) VALUES ('denso') ON CONFLICT DO NOTHING;
INSERT INTO posts_tags (post_id, tag_id) VALUES (13,
(SELECT id FROM tags WHERE tag = 'denso'));
INSERT INTO tags (tag) VALUES ('starter') ON CONFLICT DO NOTHING;
INSERT INTO posts_tags (post_id, tag_id) VALUES (14,
(SELECT id FROM tags WHERE tag = 'starter'));
INSERT INTO tags (tag) VALUES ('N52') ON CONFLICT DO NOTHING;
INSERT INTO posts_tags (post_id, tag_id) VALUES (15,
(SELECT id FROM tags WHERE tag = 'N52'));
INSERT INTO tags (tag) VALUES ('VIN 5') ON CONFLICT DO NOTHING;
INSERT INTO posts_tags (post_id, tag_id) VALUES (16,
(SELECT id FROM tags WHERE tag = 'VIN 5'));
INSERT INTO tags (tag) VALUES ('radiator') ON CONFLICT DO NOTHING;
INSERT INTO posts_tags (post_id, tag_id) VALUES (17,
(SELECT id FROM tags WHERE tag = 'radiator'));
INSERT INTO tags (tag) VALUES ('belt') ON CONFLICT DO NOTHING;
INSERT INTO posts_tags (post_id, tag_id) VALUES (18,
(SELECT id FROM tags WHERE tag = 'belt'));
INSERT INTO tags (tag) VALUES ('air filter') ON CONFLICT DO NOTHING;
INSERT INTO posts_tags (post_id, tag_id) VALUES (19,
(SELECT id FROM tags WHERE tag = 'air filter'));
INSERT INTO tags (tag) VALUES ('sunroof') ON CONFLICT DO NOTHING;
INSERT INTO posts_tags (post_id, tag_id) VALUES (20,
(SELECT id FROM tags WHERE tag = 'sunroof'));
/************************************************************
INSERT comments
*************************************************************/
INSERT INTO comments (comment, post_id, user_id)
VALUES ('Cool post dude!', 20, 1),
('Nice job.', 11, 2),
('Thanks for posting', 12, 3),
('I like this approach', 13, 4),
('Never thought of that before', 14, 5),
('What tool are you using in step 5?', 15, 6),
('How long does this take?', 16, 7),
('Super cool', 17, 8),
('This confuses me', 18, 9),
('Be careful', 19, 10);