-
Notifications
You must be signed in to change notification settings - Fork 0
/
twizzler.sql
464 lines (324 loc) · 10.8 KB
/
twizzler.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: groups; Type: TABLE; Schema: public; Owner: jasoncurran; Tablespace:
--
CREATE TABLE groups (
id integer NOT NULL,
name character varying
);
ALTER TABLE groups OWNER TO jasoncurran;
--
-- Name: groups_id_seq; Type: SEQUENCE; Schema: public; Owner: jasoncurran
--
CREATE SEQUENCE groups_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE groups_id_seq OWNER TO jasoncurran;
--
-- Name: groups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: jasoncurran
--
ALTER SEQUENCE groups_id_seq OWNED BY groups.id;
--
-- Name: relationships; Type: TABLE; Schema: public; Owner: jasoncurran; Tablespace:
--
CREATE TABLE relationships (
id integer NOT NULL,
follower_id integer,
followed_id integer
);
ALTER TABLE relationships OWNER TO jasoncurran;
--
-- Name: relationships_id_seq; Type: SEQUENCE; Schema: public; Owner: jasoncurran
--
CREATE SEQUENCE relationships_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE relationships_id_seq OWNER TO jasoncurran;
--
-- Name: relationships_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: jasoncurran
--
ALTER SEQUENCE relationships_id_seq OWNED BY relationships.id;
--
-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: jasoncurran; Tablespace:
--
CREATE TABLE schema_migrations (
version character varying NOT NULL
);
ALTER TABLE schema_migrations OWNER TO jasoncurran;
--
-- Name: twizzles; Type: TABLE; Schema: public; Owner: jasoncurran; Tablespace:
--
CREATE TABLE twizzles (
id integer NOT NULL,
user_id integer,
content character varying,
created_at character varying,
updated_at character varying
);
ALTER TABLE twizzles OWNER TO jasoncurran;
--
-- Name: twizzles_id_seq; Type: SEQUENCE; Schema: public; Owner: jasoncurran
--
CREATE SEQUENCE twizzles_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE twizzles_id_seq OWNER TO jasoncurran;
--
-- Name: twizzles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: jasoncurran
--
ALTER SEQUENCE twizzles_id_seq OWNED BY twizzles.id;
--
-- Name: user_groups; Type: TABLE; Schema: public; Owner: jasoncurran; Tablespace:
--
CREATE TABLE user_groups (
id integer NOT NULL,
group_id integer,
user_id integer
);
ALTER TABLE user_groups OWNER TO jasoncurran;
--
-- Name: user_groups_id_seq; Type: SEQUENCE; Schema: public; Owner: jasoncurran
--
CREATE SEQUENCE user_groups_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE user_groups_id_seq OWNER TO jasoncurran;
--
-- Name: user_groups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: jasoncurran
--
ALTER SEQUENCE user_groups_id_seq OWNED BY user_groups.id;
--
-- Name: users; Type: TABLE; Schema: public; Owner: jasoncurran; Tablespace:
--
CREATE TABLE users (
id integer NOT NULL,
username character varying,
fname character varying,
lname character varying,
headline character varying,
email character varying,
password character varying
);
ALTER TABLE users OWNER TO jasoncurran;
--
-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: jasoncurran
--
CREATE SEQUENCE users_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE users_id_seq OWNER TO jasoncurran;
--
-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: jasoncurran
--
ALTER SEQUENCE users_id_seq OWNED BY users.id;
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: jasoncurran
--
ALTER TABLE ONLY groups ALTER COLUMN id SET DEFAULT nextval('groups_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: jasoncurran
--
ALTER TABLE ONLY relationships ALTER COLUMN id SET DEFAULT nextval('relationships_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: jasoncurran
--
ALTER TABLE ONLY twizzles ALTER COLUMN id SET DEFAULT nextval('twizzles_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: jasoncurran
--
ALTER TABLE ONLY user_groups ALTER COLUMN id SET DEFAULT nextval('user_groups_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: jasoncurran
--
ALTER TABLE ONLY users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass);
--
-- Data for Name: groups; Type: TABLE DATA; Schema: public; Owner: jasoncurran
--
COPY groups (id, name) FROM stdin;
1 white people
2 rappers
3 black people
4 men
5 women
6 reality tv
\.
--
-- Name: groups_id_seq; Type: SEQUENCE SET; Schema: public; Owner: jasoncurran
--
SELECT pg_catalog.setval('groups_id_seq', 1, false);
--
-- Data for Name: relationships; Type: TABLE DATA; Schema: public; Owner: jasoncurran
--
COPY relationships (id, follower_id, followed_id) FROM stdin;
18 2 4
19 6 4
25 2 17
36 5 20
\.
--
-- Name: relationships_id_seq; Type: SEQUENCE SET; Schema: public; Owner: jasoncurran
--
SELECT pg_catalog.setval('relationships_id_seq', 1, false);
--
-- Data for Name: schema_migrations; Type: TABLE DATA; Schema: public; Owner: jasoncurran
--
COPY schema_migrations (version) FROM stdin;
20151019100422
20151019100538
20151019100702
20151019100835
20151019101010
\.
--
-- Data for Name: twizzles; Type: TABLE DATA; Schema: public; Owner: jasoncurran
--
COPY twizzles (id, user_id, content, created_at, updated_at) FROM stdin;
4 7 One Twizzle 2015-10-18 06:33:37 UTC 2015-10-18 06:33:37 UTC
5 7 Second Twizzle 2015-10-18 06:33:37 UTC 2015-10-18 06:33:37 UTC
6 7 This is a example of a really long Twizzle. This is a example of a really long Twizzle. This is a example of a really long Twizzle. This is a example of a really long Twizzle. This is a example of a really long Twizzle. This is a example of a really long Twizzle. This is a example of a really long Twizzle. This is a example of a really long Twizzle. This is a example of a really long Twizzle. 2015-10-18 06:33:37 UTC 2015-10-18 06:33:37 UTC
7 7 Twizzle Fo Shizzle 2015-10-18 06:33:37 UTC 2015-10-18 06:33:37 UTC
15 10 I have blonde hair 2015-10-18 06:33:37 UTC 2015-10-18 06:33:37 UTC
16 2 I hate Kanye West 2015-10-18 06:33:37 UTC 2015-10-18 06:33:37 UTC
17 5 I ain't saying she's a gold digger. 2015-10-18 06:33:37 UTC 2015-10-18 06:33:37 UTC
18 5 I'm sorry Taylor, but Beyonce is the best 2015-10-18 06:33:37 UTC 2015-10-18 06:33:37 UTC
19 5 Through the Wire 2015-10-18 06:33:37 UTC 2015-10-18 06:33:37 UTC
20 4 Fire fire fire fire fire 2015-10-18 06:33:37 UTC 2015-10-18 06:33:37 UTC
21 3 My name is Alicia 2015-10-18 06:33:37 UTC 2015-10-18 06:33:37 UTC
22 2 This girl is on fire 2015-10-18 06:33:37 UTC 2015-10-18 06:33:37 UTC
25 0 sdsdsad 2015-10-18 06:33:37 UTC 2015-10-18 06:33:37 UTC
29 13 my balls are small 2015-10-18 06:36:54 UTC 2015-10-18 06:36:54 UTC
30 13 why are my twizzles appearing 2015-10-18 06:37:13 UTC 2015-10-18 06:37:13 UTC
32 5 This is an example of a really long tweet by Kanye West 2015-10-18 10:30:00 UTC 2015-10-18 10:30:00 UTC
33 4 why isnt this working 2015-10-18 10:39:13 UTC 2015-10-18 10:39:13 UTC
36 4 hello 2015-10-18 11:17:26 UTC 2015-10-18 11:17:26 UTC
38 17 Hi guys! 2015-10-18 15:52:52 UTC 2015-10-18 15:52:52 UTC
39 20 I like Jayden's Tweet's 2015-10-18 17:31:22 UTC 2015-10-18 17:31:22 UTC
40 20 cvcvcvcvcvcvcvcvcxvcxv 2015-10-19 02:20:33 UTC 2015-10-19 02:20:33 UTC
\.
--
-- Name: twizzles_id_seq; Type: SEQUENCE SET; Schema: public; Owner: jasoncurran
--
SELECT pg_catalog.setval('twizzles_id_seq', 1, false);
--
-- Data for Name: user_groups; Type: TABLE DATA; Schema: public; Owner: jasoncurran
--
COPY user_groups (id, group_id, user_id) FROM stdin;
1 1 1
2 1 2
3 1 4
4 1 9
5 1 10
6 2 3
7 2 5
8 2 7
9 3 3
10 3 5
11 3 7
12 4 2
13 4 3
14 4 5
15 4 7
16 5 1
17 5 4
18 5 6
19 5 9
20 5 10
21 6 6
\.
--
-- Name: user_groups_id_seq; Type: SEQUENCE SET; Schema: public; Owner: jasoncurran
--
SELECT pg_catalog.setval('user_groups_id_seq', 1, false);
--
-- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: jasoncurran
--
COPY users (id, username, fname, lname, headline, email, password) FROM stdin;
2 jonbonjovi Jon BonJovi 22222 jonbonjovi@gmail.com password
3 rickross Rick Ross 33333 rickross@gmail.com password
4 taylorswift Taylor Swift 44444 taylorswift@gmail.com password
5 kanyewest Kanye West 55555 kanyewest@gmail.com password
6 kimkardashian Kim Kardashian 66666 kimkardashian@gmail.com password
7 snoopdogg Snoop Dogg 77777 snoopdogg@gmail.com password
9 ladygaga Lady Gaga 99999 ladygaga@gmail.com password
10 iggyazalea Iggy Azalea 1010101010 iggyazalea@gmail.com password
17 amberrose Amber Rose I like Wiz Khalifa amberrose@gmail.com password
20 willsmith Will Smith Getting Jiggy With It willsmith@gmail.com password
25 justintimberlake Justin Timberlake I'm bringing sexy back! justintimberlake@gmail.com password
\.
--
-- Name: users_id_seq; Type: SEQUENCE SET; Schema: public; Owner: jasoncurran
--
SELECT pg_catalog.setval('users_id_seq', 1, false);
--
-- Name: groups_pkey; Type: CONSTRAINT; Schema: public; Owner: jasoncurran; Tablespace:
--
ALTER TABLE ONLY groups
ADD CONSTRAINT groups_pkey PRIMARY KEY (id);
--
-- Name: relationships_pkey; Type: CONSTRAINT; Schema: public; Owner: jasoncurran; Tablespace:
--
ALTER TABLE ONLY relationships
ADD CONSTRAINT relationships_pkey PRIMARY KEY (id);
--
-- Name: twizzles_pkey; Type: CONSTRAINT; Schema: public; Owner: jasoncurran; Tablespace:
--
ALTER TABLE ONLY twizzles
ADD CONSTRAINT twizzles_pkey PRIMARY KEY (id);
--
-- Name: user_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: jasoncurran; Tablespace:
--
ALTER TABLE ONLY user_groups
ADD CONSTRAINT user_groups_pkey PRIMARY KEY (id);
--
-- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: jasoncurran; Tablespace:
--
ALTER TABLE ONLY users
ADD CONSTRAINT users_pkey PRIMARY KEY (id);
--
-- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: jasoncurran; Tablespace:
--
CREATE UNIQUE INDEX unique_schema_migrations ON schema_migrations USING btree (version);
--
-- Name: public; Type: ACL; Schema: -; Owner: jasoncurran
--
REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM jasoncurran;
GRANT ALL ON SCHEMA public TO jasoncurran;
GRANT ALL ON SCHEMA public TO PUBLIC;
--
-- PostgreSQL database dump complete
--