forked from discourse/discourse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
production-image.sql
6342 lines (4435 loc) · 204 KB
/
production-image.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
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET search_path = public, pg_catalog;
DROP INDEX public.unique_schema_migrations;
DROP INDEX public.post_timings_unique;
DROP INDEX public.post_timings_summary;
DROP INDEX public.index_views_on_parent_id_and_parent_type;
DROP INDEX public.index_versions_on_versioned_id_and_versioned_type;
DROP INDEX public.index_versions_on_user_name;
DROP INDEX public.index_versions_on_user_id_and_user_type;
DROP INDEX public.index_versions_on_tag;
DROP INDEX public.index_versions_on_number;
DROP INDEX public.index_versions_on_created_at;
DROP INDEX public.index_users_on_username_lower;
DROP INDEX public.index_users_on_username;
DROP INDEX public.index_users_on_last_posted_at;
DROP INDEX public.index_users_on_email;
DROP INDEX public.index_users_on_auth_token;
DROP INDEX public.index_user_visits_on_user_id_and_visited_at;
DROP INDEX public.index_user_open_ids_on_url;
DROP INDEX public.index_uploads_on_user_id;
DROP INDEX public.index_uploads_on_forum_thread_id;
DROP INDEX public.index_twitter_user_infos_on_user_id;
DROP INDEX public.index_twitter_user_infos_on_twitter_user_id;
DROP INDEX public.index_topic_invites_on_topic_id_and_invite_id;
DROP INDEX public.index_topic_invites_on_invite_id;
DROP INDEX public.index_topic_allowed_users_on_user_id_and_topic_id;
DROP INDEX public.index_topic_allowed_users_on_topic_id_and_user_id;
DROP INDEX public.index_site_customizations_on_key;
DROP INDEX public.index_posts_on_topic_id_and_post_number;
DROP INDEX public.index_posts_on_reply_to_post_number;
DROP INDEX public.index_post_replies_on_post_id_and_reply_id;
DROP INDEX public.index_post_onebox_renders_on_post_id_and_onebox_render_id;
DROP INDEX public.index_post_actions_on_post_id;
DROP INDEX public.index_onebox_renders_on_url;
DROP INDEX public.index_notifications_on_user_id_and_created_at;
DROP INDEX public.index_notifications_on_post_action_id;
DROP INDEX public.index_message_bus_on_created_at;
DROP INDEX public.index_invites_on_invite_key;
DROP INDEX public.index_invites_on_email_and_invited_by_id;
DROP INDEX public.index_github_user_infos_on_user_id;
DROP INDEX public.index_github_user_infos_on_github_user_id;
DROP INDEX public.index_forum_threads_on_bumped_at;
DROP INDEX public.index_forum_thread_users_on_forum_thread_id_and_user_id;
DROP INDEX public.index_forum_thread_links_on_forum_thread_id_and_post_id_and_url;
DROP INDEX public.index_forum_thread_links_on_forum_thread_id;
DROP INDEX public.index_forum_thread_link_clicks_on_forum_thread_link_id;
DROP INDEX public.index_facebook_user_infos_on_user_id;
DROP INDEX public.index_facebook_user_infos_on_facebook_user_id;
DROP INDEX public.index_email_tokens_on_token;
DROP INDEX public.index_email_logs_on_user_id_and_created_at;
DROP INDEX public.index_email_logs_on_created_at;
DROP INDEX public.index_drafts_on_user_id_and_draft_key;
DROP INDEX public.index_draft_sequences_on_user_id_and_draft_key;
DROP INDEX public.index_category_featured_users_on_category_id_and_user_id;
DROP INDEX public.index_categories_on_name;
DROP INDEX public.index_categories_on_forum_thread_count;
DROP INDEX public.index_actions_on_user_id_and_action_type;
DROP INDEX public.index_actions_on_acting_user_id;
DROP INDEX public.incoming_index;
DROP INDEX public.idx_unique_rows;
DROP INDEX public.idx_unique_actions;
DROP INDEX public.idx_topics_user_id_deleted_at;
DROP INDEX public.idx_search_user;
DROP INDEX public.idx_search_post;
DROP INDEX public.idx_search_category;
DROP INDEX public.idx_posts_user_id_deleted_at;
DROP INDEX public.cat_featured_threads;
SET search_path = backup, pg_catalog;
DROP INDEX backup.unique_views;
DROP INDEX backup.post_timings_unique;
DROP INDEX backup.post_timings_summary;
DROP INDEX backup.index_views_on_parent_id_and_parent_type;
DROP INDEX backup.index_versions_on_versioned_id_and_versioned_type;
DROP INDEX backup.index_versions_on_user_name;
DROP INDEX backup.index_versions_on_user_id_and_user_type;
DROP INDEX backup.index_versions_on_tag;
DROP INDEX backup.index_versions_on_number;
DROP INDEX backup.index_versions_on_created_at;
DROP INDEX backup.index_users_on_username_lower;
DROP INDEX backup.index_users_on_username;
DROP INDEX backup.index_users_on_last_posted_at;
DROP INDEX backup.index_users_on_email;
DROP INDEX backup.index_users_on_auth_token;
DROP INDEX backup.index_user_visits_on_user_id_and_visited_at;
DROP INDEX backup.index_user_open_ids_on_url;
DROP INDEX backup.index_uploads_on_user_id;
DROP INDEX backup.index_uploads_on_forum_thread_id;
DROP INDEX backup.index_twitter_user_infos_on_user_id;
DROP INDEX backup.index_twitter_user_infos_on_twitter_user_id;
DROP INDEX backup.index_topic_invites_on_topic_id_and_invite_id;
DROP INDEX backup.index_topic_invites_on_invite_id;
DROP INDEX backup.index_topic_allowed_users_on_user_id_and_topic_id;
DROP INDEX backup.index_topic_allowed_users_on_topic_id_and_user_id;
DROP INDEX backup.index_site_customizations_on_key;
DROP INDEX backup.index_posts_on_topic_id_and_post_number;
DROP INDEX backup.index_posts_on_reply_to_post_number;
DROP INDEX backup.index_post_replies_on_post_id_and_reply_id;
DROP INDEX backup.index_post_onebox_renders_on_post_id_and_onebox_render_id;
DROP INDEX backup.index_post_actions_on_post_id;
DROP INDEX backup.index_onebox_renders_on_url;
DROP INDEX backup.index_notifications_on_user_id_and_created_at;
DROP INDEX backup.index_notifications_on_post_action_id;
DROP INDEX backup.index_invites_on_invite_key;
DROP INDEX backup.index_invites_on_email_and_invited_by_id;
DROP INDEX backup.index_forum_threads_on_category_id_and_sub_tag_and_bumped_at;
DROP INDEX backup.index_forum_threads_on_bumped_at;
DROP INDEX backup.index_forum_thread_users_on_forum_thread_id_and_user_id;
DROP INDEX backup.index_forum_thread_links_on_forum_thread_id_and_post_id_and_url;
DROP INDEX backup.index_forum_thread_links_on_forum_thread_id;
DROP INDEX backup.index_forum_thread_link_clicks_on_forum_thread_link_id;
DROP INDEX backup.index_facebook_user_infos_on_user_id;
DROP INDEX backup.index_facebook_user_infos_on_facebook_user_id;
DROP INDEX backup.index_email_tokens_on_token;
DROP INDEX backup.index_email_logs_on_user_id_and_created_at;
DROP INDEX backup.index_email_logs_on_created_at;
DROP INDEX backup.index_drafts_on_user_id_and_draft_key;
DROP INDEX backup.index_draft_sequences_on_user_id_and_draft_key;
DROP INDEX backup.index_category_featured_users_on_category_id_and_user_id;
DROP INDEX backup.index_categories_on_name;
DROP INDEX backup.index_categories_on_forum_thread_count;
DROP INDEX backup.index_actions_on_user_id_and_action_type;
DROP INDEX backup.index_actions_on_acting_user_id;
DROP INDEX backup.incoming_index;
DROP INDEX backup.idx_unique_rows;
DROP INDEX backup.idx_unique_actions;
DROP INDEX backup.idx_search_user;
DROP INDEX backup.idx_search_thread;
DROP INDEX backup.cat_featured_threads;
SET search_path = public, pg_catalog;
ALTER TABLE ONLY public.versions DROP CONSTRAINT versions_pkey;
ALTER TABLE ONLY public.users_search DROP CONSTRAINT users_search_pkey;
ALTER TABLE ONLY public.users DROP CONSTRAINT users_pkey;
ALTER TABLE ONLY public.user_visits DROP CONSTRAINT user_visits_pkey;
ALTER TABLE ONLY public.user_open_ids DROP CONSTRAINT user_open_ids_pkey;
ALTER TABLE ONLY public.uploads DROP CONSTRAINT uploads_pkey;
ALTER TABLE ONLY public.twitter_user_infos DROP CONSTRAINT twitter_user_infos_pkey;
ALTER TABLE ONLY public.topic_invites DROP CONSTRAINT topic_invites_pkey;
ALTER TABLE ONLY public.topic_allowed_users DROP CONSTRAINT topic_allowed_users_pkey;
ALTER TABLE ONLY public.site_settings DROP CONSTRAINT site_settings_pkey;
ALTER TABLE ONLY public.site_customizations DROP CONSTRAINT site_customizations_pkey;
ALTER TABLE ONLY public.posts_search DROP CONSTRAINT posts_search_pkey;
ALTER TABLE ONLY public.posts DROP CONSTRAINT posts_pkey;
ALTER TABLE ONLY public.post_actions DROP CONSTRAINT post_actions_pkey;
ALTER TABLE ONLY public.post_action_types DROP CONSTRAINT post_action_types_pkey;
ALTER TABLE ONLY public.onebox_renders DROP CONSTRAINT onebox_renders_pkey;
ALTER TABLE ONLY public.notifications DROP CONSTRAINT notifications_pkey;
ALTER TABLE ONLY public.message_bus DROP CONSTRAINT message_bus_pkey;
ALTER TABLE ONLY public.invites DROP CONSTRAINT invites_pkey;
ALTER TABLE ONLY public.incoming_links DROP CONSTRAINT incoming_links_pkey;
ALTER TABLE ONLY public.github_user_infos DROP CONSTRAINT github_user_infos_pkey;
ALTER TABLE ONLY public.topics DROP CONSTRAINT forum_threads_pkey;
ALTER TABLE ONLY public.topic_links DROP CONSTRAINT forum_thread_links_pkey;
ALTER TABLE ONLY public.topic_link_clicks DROP CONSTRAINT forum_thread_link_clicks_pkey;
ALTER TABLE ONLY public.facebook_user_infos DROP CONSTRAINT facebook_user_infos_pkey;
ALTER TABLE ONLY public.email_tokens DROP CONSTRAINT email_tokens_pkey;
ALTER TABLE ONLY public.email_logs DROP CONSTRAINT email_logs_pkey;
ALTER TABLE ONLY public.drafts DROP CONSTRAINT drafts_pkey;
ALTER TABLE ONLY public.draft_sequences DROP CONSTRAINT draft_sequences_pkey;
ALTER TABLE ONLY public.category_featured_users DROP CONSTRAINT category_featured_users_pkey;
ALTER TABLE ONLY public.categories_search DROP CONSTRAINT categories_search_pkey;
ALTER TABLE ONLY public.categories DROP CONSTRAINT categories_pkey;
ALTER TABLE ONLY public.user_actions DROP CONSTRAINT actions_pkey;
SET search_path = backup, pg_catalog;
ALTER TABLE ONLY backup.versions DROP CONSTRAINT versions_pkey;
ALTER TABLE ONLY backup.users DROP CONSTRAINT users_pkey;
ALTER TABLE ONLY backup.user_visits DROP CONSTRAINT user_visits_pkey;
ALTER TABLE ONLY backup.user_open_ids DROP CONSTRAINT user_open_ids_pkey;
ALTER TABLE ONLY backup.uploads DROP CONSTRAINT uploads_pkey;
ALTER TABLE ONLY backup.twitter_user_infos DROP CONSTRAINT twitter_user_infos_pkey;
ALTER TABLE ONLY backup.trust_levels DROP CONSTRAINT trust_levels_pkey;
ALTER TABLE ONLY backup.topic_invites DROP CONSTRAINT topic_invites_pkey;
ALTER TABLE ONLY backup.topic_allowed_users DROP CONSTRAINT topic_allowed_users_pkey;
ALTER TABLE ONLY backup.site_settings DROP CONSTRAINT site_settings_pkey;
ALTER TABLE ONLY backup.site_customizations DROP CONSTRAINT site_customizations_pkey;
ALTER TABLE ONLY backup.posts DROP CONSTRAINT posts_pkey;
ALTER TABLE ONLY backup.post_actions DROP CONSTRAINT post_actions_pkey;
ALTER TABLE ONLY backup.post_action_types DROP CONSTRAINT post_action_types_pkey;
ALTER TABLE ONLY backup.onebox_renders DROP CONSTRAINT onebox_renders_pkey;
ALTER TABLE ONLY backup.notifications DROP CONSTRAINT notifications_pkey;
ALTER TABLE ONLY backup.invites DROP CONSTRAINT invites_pkey;
ALTER TABLE ONLY backup.incoming_links DROP CONSTRAINT incoming_links_pkey;
ALTER TABLE ONLY backup.topics DROP CONSTRAINT forum_threads_pkey;
ALTER TABLE ONLY backup.topic_links DROP CONSTRAINT forum_thread_links_pkey;
ALTER TABLE ONLY backup.topic_link_clicks DROP CONSTRAINT forum_thread_link_clicks_pkey;
ALTER TABLE ONLY backup.facebook_user_infos DROP CONSTRAINT facebook_user_infos_pkey;
ALTER TABLE ONLY backup.email_tokens DROP CONSTRAINT email_tokens_pkey;
ALTER TABLE ONLY backup.email_logs DROP CONSTRAINT email_logs_pkey;
ALTER TABLE ONLY backup.drafts DROP CONSTRAINT drafts_pkey;
ALTER TABLE ONLY backup.draft_sequences DROP CONSTRAINT draft_sequences_pkey;
ALTER TABLE ONLY backup.category_featured_users DROP CONSTRAINT category_featured_users_pkey;
ALTER TABLE ONLY backup.categories DROP CONSTRAINT categories_pkey;
ALTER TABLE ONLY backup.user_actions DROP CONSTRAINT actions_pkey;
SET search_path = public, pg_catalog;
SET search_path = backup, pg_catalog;
SET search_path = public, pg_catalog;
ALTER TABLE public.versions ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.users ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.user_visits ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.user_open_ids ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.user_actions ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.uploads ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.twitter_user_infos ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.topics ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.topic_links ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.topic_link_clicks ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.topic_invites ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.topic_allowed_users ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.site_settings ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.site_customizations ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.posts ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.post_actions ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.post_action_types ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.onebox_renders ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.notifications ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.message_bus ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.invites ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.incoming_links ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.github_user_infos ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.facebook_user_infos ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.email_tokens ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.email_logs ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.drafts ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.draft_sequences ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.category_featured_users ALTER COLUMN id DROP DEFAULT;
ALTER TABLE public.categories ALTER COLUMN id DROP DEFAULT;
SET search_path = backup, pg_catalog;
ALTER TABLE backup.versions ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.users ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.user_visits ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.user_open_ids ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.user_actions ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.uploads ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.twitter_user_infos ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.trust_levels ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.topics ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.topic_links ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.topic_link_clicks ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.topic_invites ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.topic_allowed_users ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.site_settings ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.site_customizations ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.posts ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.post_actions ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.post_action_types ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.onebox_renders ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.notifications ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.invites ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.incoming_links ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.facebook_user_infos ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.email_tokens ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.email_logs ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.drafts ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.draft_sequences ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.category_featured_users ALTER COLUMN id DROP DEFAULT;
ALTER TABLE backup.categories ALTER COLUMN id DROP DEFAULT;
SET search_path = public, pg_catalog;
DROP TABLE public.views;
DROP SEQUENCE public.versions_id_seq;
DROP TABLE public.versions;
DROP TABLE public.users_search;
DROP SEQUENCE public.users_id_seq;
DROP TABLE public.users;
DROP SEQUENCE public.user_visits_id_seq;
DROP TABLE public.user_visits;
DROP SEQUENCE public.user_open_ids_id_seq;
DROP TABLE public.user_open_ids;
DROP SEQUENCE public.user_actions_id_seq;
DROP TABLE public.user_actions;
DROP SEQUENCE public.uploads_id_seq;
DROP TABLE public.uploads;
DROP SEQUENCE public.twitter_user_infos_id_seq;
DROP TABLE public.twitter_user_infos;
DROP SEQUENCE public.topics_id_seq;
DROP TABLE public.topics;
DROP TABLE public.topic_users;
DROP SEQUENCE public.topic_links_id_seq;
DROP TABLE public.topic_links;
DROP SEQUENCE public.topic_link_clicks_id_seq;
DROP TABLE public.topic_link_clicks;
DROP SEQUENCE public.topic_invites_id_seq;
DROP TABLE public.topic_invites;
DROP SEQUENCE public.topic_allowed_users_id_seq;
DROP TABLE public.topic_allowed_users;
DROP SEQUENCE public.site_settings_id_seq;
DROP TABLE public.site_settings;
DROP SEQUENCE public.site_customizations_id_seq;
DROP TABLE public.site_customizations;
DROP TABLE public.schema_migrations;
DROP TABLE public.posts_search;
DROP SEQUENCE public.posts_id_seq;
DROP TABLE public.posts;
DROP TABLE public.post_timings;
DROP TABLE public.post_replies;
DROP TABLE public.post_onebox_renders;
DROP SEQUENCE public.post_actions_id_seq;
DROP TABLE public.post_actions;
DROP SEQUENCE public.post_action_types_id_seq;
DROP TABLE public.post_action_types;
DROP SEQUENCE public.onebox_renders_id_seq;
DROP TABLE public.onebox_renders;
DROP SEQUENCE public.notifications_id_seq;
DROP TABLE public.notifications;
DROP SEQUENCE public.message_bus_id_seq;
DROP TABLE public.message_bus;
DROP SEQUENCE public.invites_id_seq;
DROP TABLE public.invites;
DROP SEQUENCE public.incoming_links_id_seq;
DROP TABLE public.incoming_links;
DROP SEQUENCE public.github_user_infos_id_seq;
DROP TABLE public.github_user_infos;
DROP SEQUENCE public.facebook_user_infos_id_seq;
DROP TABLE public.facebook_user_infos;
DROP SEQUENCE public.email_tokens_id_seq;
DROP TABLE public.email_tokens;
DROP SEQUENCE public.email_logs_id_seq;
DROP TABLE public.email_logs;
DROP SEQUENCE public.drafts_id_seq;
DROP TABLE public.drafts;
DROP SEQUENCE public.draft_sequences_id_seq;
DROP TABLE public.draft_sequences;
DROP SEQUENCE public.category_featured_users_id_seq;
DROP TABLE public.category_featured_users;
DROP TABLE public.category_featured_topics;
DROP TABLE public.categories_search;
DROP SEQUENCE public.categories_id_seq;
DROP TABLE public.categories;
SET search_path = backup, pg_catalog;
DROP TABLE backup.views;
DROP SEQUENCE backup.versions_id_seq;
DROP TABLE backup.versions;
DROP SEQUENCE backup.users_id_seq;
DROP TABLE backup.users;
DROP SEQUENCE backup.user_visits_id_seq;
DROP TABLE backup.user_visits;
DROP SEQUENCE backup.user_open_ids_id_seq;
DROP TABLE backup.user_open_ids;
DROP SEQUENCE backup.user_actions_id_seq;
DROP TABLE backup.user_actions;
DROP SEQUENCE backup.uploads_id_seq;
DROP TABLE backup.uploads;
DROP SEQUENCE backup.twitter_user_infos_id_seq;
DROP TABLE backup.twitter_user_infos;
DROP SEQUENCE backup.trust_levels_id_seq;
DROP TABLE backup.trust_levels;
DROP SEQUENCE backup.topics_id_seq;
DROP TABLE backup.topics;
DROP TABLE backup.topic_users;
DROP SEQUENCE backup.topic_links_id_seq;
DROP TABLE backup.topic_links;
DROP SEQUENCE backup.topic_link_clicks_id_seq;
DROP TABLE backup.topic_link_clicks;
DROP SEQUENCE backup.topic_invites_id_seq;
DROP TABLE backup.topic_invites;
DROP SEQUENCE backup.topic_allowed_users_id_seq;
DROP TABLE backup.topic_allowed_users;
DROP SEQUENCE backup.site_settings_id_seq;
DROP TABLE backup.site_settings;
DROP SEQUENCE backup.site_customizations_id_seq;
DROP TABLE backup.site_customizations;
DROP SEQUENCE backup.posts_id_seq;
DROP TABLE backup.posts;
DROP TABLE backup.post_timings;
DROP TABLE backup.post_replies;
DROP TABLE backup.post_onebox_renders;
DROP SEQUENCE backup.post_actions_id_seq;
DROP TABLE backup.post_actions;
DROP SEQUENCE backup.post_action_types_id_seq;
DROP TABLE backup.post_action_types;
DROP SEQUENCE backup.onebox_renders_id_seq;
DROP TABLE backup.onebox_renders;
DROP SEQUENCE backup.notifications_id_seq;
DROP TABLE backup.notifications;
DROP SEQUENCE backup.invites_id_seq;
DROP TABLE backup.invites;
DROP SEQUENCE backup.incoming_links_id_seq;
DROP TABLE backup.incoming_links;
DROP SEQUENCE backup.facebook_user_infos_id_seq;
DROP TABLE backup.facebook_user_infos;
DROP SEQUENCE backup.email_tokens_id_seq;
DROP TABLE backup.email_tokens;
DROP SEQUENCE backup.email_logs_id_seq;
DROP TABLE backup.email_logs;
DROP SEQUENCE backup.drafts_id_seq;
DROP TABLE backup.drafts;
DROP SEQUENCE backup.draft_sequences_id_seq;
DROP TABLE backup.draft_sequences;
DROP SEQUENCE backup.category_featured_users_id_seq;
DROP TABLE backup.category_featured_users;
DROP TABLE backup.category_featured_topics;
DROP SEQUENCE backup.categories_id_seq;
DROP TABLE backup.categories;
DROP EXTENSION pg_trgm;
DROP EXTENSION hstore;
DROP EXTENSION plpgsql;
DROP SCHEMA public;
DROP SCHEMA backup;
--
-- Name: backup; Type: SCHEMA; Schema: -; Owner: vagrant
--
CREATE SCHEMA backup;
ALTER SCHEMA backup OWNER TO vagrant;
--
-- Name: public; Type: SCHEMA; Schema: -; Owner: postgres
--
CREATE SCHEMA public;
ALTER SCHEMA public OWNER TO postgres;
--
-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
--
COMMENT ON SCHEMA public IS 'standard public schema';
--
-- 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';
--
-- Name: hstore; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS hstore WITH SCHEMA public;
--
-- Name: EXTENSION hstore; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION hstore IS 'data type for storing sets of (key, value) pairs';
--
-- Name: pg_trgm; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA public;
--
-- Name: EXTENSION pg_trgm; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION pg_trgm IS 'text similarity measurement and index searching based on trigrams';
SET search_path = backup, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: categories; Type: TABLE; Schema: backup; Owner: vagrant; Tablespace:
--
CREATE TABLE categories (
id integer NOT NULL,
name character varying(50) NOT NULL,
color character varying(6) DEFAULT 'AB9364'::character varying NOT NULL,
topic_id integer,
top1_topic_id integer,
top2_topic_id integer,
top1_user_id integer,
top2_user_id integer,
topic_count integer DEFAULT 0 NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
user_id integer NOT NULL,
topics_year integer,
topics_month integer,
topics_week integer,
slug character varying(255) NOT NULL
);
ALTER TABLE backup.categories OWNER TO vagrant;
--
-- Name: categories_id_seq; Type: SEQUENCE; Schema: backup; Owner: vagrant
--
CREATE SEQUENCE categories_id_seq
START WITH 5
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE backup.categories_id_seq OWNER TO vagrant;
--
-- Name: categories_id_seq; Type: SEQUENCE OWNED BY; Schema: backup; Owner: vagrant
--
ALTER SEQUENCE categories_id_seq OWNED BY categories.id;
--
-- Name: category_featured_topics; Type: TABLE; Schema: backup; Owner: vagrant; Tablespace:
--
CREATE TABLE category_featured_topics (
category_id integer NOT NULL,
topic_id integer NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
ALTER TABLE backup.category_featured_topics OWNER TO vagrant;
--
-- Name: category_featured_users; Type: TABLE; Schema: backup; Owner: vagrant; Tablespace:
--
CREATE TABLE category_featured_users (
id integer NOT NULL,
category_id integer,
user_id integer,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
ALTER TABLE backup.category_featured_users OWNER TO vagrant;
--
-- Name: category_featured_users_id_seq; Type: SEQUENCE; Schema: backup; Owner: vagrant
--
CREATE SEQUENCE category_featured_users_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE backup.category_featured_users_id_seq OWNER TO vagrant;
--
-- Name: category_featured_users_id_seq; Type: SEQUENCE OWNED BY; Schema: backup; Owner: vagrant
--
ALTER SEQUENCE category_featured_users_id_seq OWNED BY category_featured_users.id;
--
-- Name: draft_sequences; Type: TABLE; Schema: backup; Owner: vagrant; Tablespace:
--
CREATE TABLE draft_sequences (
id integer NOT NULL,
user_id integer NOT NULL,
draft_key character varying(255) NOT NULL,
sequence integer NOT NULL
);
ALTER TABLE backup.draft_sequences OWNER TO vagrant;
--
-- Name: draft_sequences_id_seq; Type: SEQUENCE; Schema: backup; Owner: vagrant
--
CREATE SEQUENCE draft_sequences_id_seq
START WITH 20
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE backup.draft_sequences_id_seq OWNER TO vagrant;
--
-- Name: draft_sequences_id_seq; Type: SEQUENCE OWNED BY; Schema: backup; Owner: vagrant
--
ALTER SEQUENCE draft_sequences_id_seq OWNED BY draft_sequences.id;
--
-- Name: drafts; Type: TABLE; Schema: backup; Owner: vagrant; Tablespace:
--
CREATE TABLE drafts (
id integer NOT NULL,
user_id integer NOT NULL,
draft_key character varying(255) NOT NULL,
data text NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
sequence integer DEFAULT 0 NOT NULL
);
ALTER TABLE backup.drafts OWNER TO vagrant;
--
-- Name: drafts_id_seq; Type: SEQUENCE; Schema: backup; Owner: vagrant
--
CREATE SEQUENCE drafts_id_seq
START WITH 2
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE backup.drafts_id_seq OWNER TO vagrant;
--
-- Name: drafts_id_seq; Type: SEQUENCE OWNED BY; Schema: backup; Owner: vagrant
--
ALTER SEQUENCE drafts_id_seq OWNED BY drafts.id;
--
-- Name: email_logs; Type: TABLE; Schema: backup; Owner: vagrant; Tablespace:
--
CREATE TABLE email_logs (
id integer NOT NULL,
to_address character varying(255) NOT NULL,
email_type character varying(255) NOT NULL,
user_id integer,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
ALTER TABLE backup.email_logs OWNER TO vagrant;
--
-- Name: email_logs_id_seq; Type: SEQUENCE; Schema: backup; Owner: vagrant
--
CREATE SEQUENCE email_logs_id_seq
START WITH 3
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE backup.email_logs_id_seq OWNER TO vagrant;
--
-- Name: email_logs_id_seq; Type: SEQUENCE OWNED BY; Schema: backup; Owner: vagrant
--
ALTER SEQUENCE email_logs_id_seq OWNED BY email_logs.id;
--
-- Name: email_tokens; Type: TABLE; Schema: backup; Owner: vagrant; Tablespace:
--
CREATE TABLE email_tokens (
id integer NOT NULL,
user_id integer NOT NULL,
email character varying(255) NOT NULL,
token character varying(255) NOT NULL,
confirmed boolean DEFAULT false NOT NULL,
expired boolean DEFAULT false NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
ALTER TABLE backup.email_tokens OWNER TO vagrant;
--
-- Name: email_tokens_id_seq; Type: SEQUENCE; Schema: backup; Owner: vagrant
--
CREATE SEQUENCE email_tokens_id_seq
START WITH 3
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE backup.email_tokens_id_seq OWNER TO vagrant;
--
-- Name: email_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: backup; Owner: vagrant
--
ALTER SEQUENCE email_tokens_id_seq OWNED BY email_tokens.id;
--
-- Name: facebook_user_infos; Type: TABLE; Schema: backup; Owner: vagrant; Tablespace:
--
CREATE TABLE facebook_user_infos (
id integer NOT NULL,
user_id integer NOT NULL,
facebook_user_id integer NOT NULL,
username character varying(255) NOT NULL,
first_name character varying(255),
last_name character varying(255),
email character varying(255),
gender character varying(255),
name character varying(255),
link character varying(255),
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
ALTER TABLE backup.facebook_user_infos OWNER TO vagrant;
--
-- Name: facebook_user_infos_id_seq; Type: SEQUENCE; Schema: backup; Owner: vagrant
--
CREATE SEQUENCE facebook_user_infos_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE backup.facebook_user_infos_id_seq OWNER TO vagrant;
--
-- Name: facebook_user_infos_id_seq; Type: SEQUENCE OWNED BY; Schema: backup; Owner: vagrant
--
ALTER SEQUENCE facebook_user_infos_id_seq OWNED BY facebook_user_infos.id;
--
-- Name: incoming_links; Type: TABLE; Schema: backup; Owner: vagrant; Tablespace:
--
CREATE TABLE incoming_links (
id integer NOT NULL,
url character varying(1000) NOT NULL,
referer character varying(1000) NOT NULL,
domain character varying(100) NOT NULL,
topic_id integer,
post_number integer,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
ALTER TABLE backup.incoming_links OWNER TO vagrant;
--
-- Name: incoming_links_id_seq; Type: SEQUENCE; Schema: backup; Owner: vagrant
--
CREATE SEQUENCE incoming_links_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE backup.incoming_links_id_seq OWNER TO vagrant;
--
-- Name: incoming_links_id_seq; Type: SEQUENCE OWNED BY; Schema: backup; Owner: vagrant
--
ALTER SEQUENCE incoming_links_id_seq OWNED BY incoming_links.id;
--
-- Name: invites; Type: TABLE; Schema: backup; Owner: vagrant; Tablespace:
--
CREATE TABLE invites (
id integer NOT NULL,
invite_key character varying(32) NOT NULL,
email character varying(255) NOT NULL,
invited_by_id integer NOT NULL,
user_id integer,
redeemed_at timestamp without time zone,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
deleted_at timestamp without time zone
);
ALTER TABLE backup.invites OWNER TO vagrant;
--
-- Name: invites_id_seq; Type: SEQUENCE; Schema: backup; Owner: vagrant
--
CREATE SEQUENCE invites_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE backup.invites_id_seq OWNER TO vagrant;
--
-- Name: invites_id_seq; Type: SEQUENCE OWNED BY; Schema: backup; Owner: vagrant
--
ALTER SEQUENCE invites_id_seq OWNED BY invites.id;
--
-- Name: notifications; Type: TABLE; Schema: backup; Owner: vagrant; Tablespace:
--
CREATE TABLE notifications (
id integer NOT NULL,
notification_type integer NOT NULL,
user_id integer NOT NULL,
data character varying(255) NOT NULL,
read boolean DEFAULT false NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
topic_id integer,
post_number integer,
post_action_id integer
);
ALTER TABLE backup.notifications OWNER TO vagrant;
--
-- Name: notifications_id_seq; Type: SEQUENCE; Schema: backup; Owner: vagrant
--
CREATE SEQUENCE notifications_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE backup.notifications_id_seq OWNER TO vagrant;
--
-- Name: notifications_id_seq; Type: SEQUENCE OWNED BY; Schema: backup; Owner: vagrant
--
ALTER SEQUENCE notifications_id_seq OWNED BY notifications.id;
--
-- Name: onebox_renders; Type: TABLE; Schema: backup; Owner: vagrant; Tablespace:
--
CREATE TABLE onebox_renders (
id integer NOT NULL,
url character varying(255) NOT NULL,
cooked text NOT NULL,
expires_at timestamp without time zone NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
preview text
);
ALTER TABLE backup.onebox_renders OWNER TO vagrant;
--
-- Name: onebox_renders_id_seq; Type: SEQUENCE; Schema: backup; Owner: vagrant
--
CREATE SEQUENCE onebox_renders_id_seq
START WITH 2
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE backup.onebox_renders_id_seq OWNER TO vagrant;
--
-- Name: onebox_renders_id_seq; Type: SEQUENCE OWNED BY; Schema: backup; Owner: vagrant
--
ALTER SEQUENCE onebox_renders_id_seq OWNED BY onebox_renders.id;
--
-- Name: post_action_types; Type: TABLE; Schema: backup; Owner: vagrant; Tablespace:
--
CREATE TABLE post_action_types (
name_key character varying(50) NOT NULL,
is_flag boolean DEFAULT false NOT NULL,
icon character varying(20),
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
id integer NOT NULL
);
ALTER TABLE backup.post_action_types OWNER TO vagrant;
--
-- Name: post_action_types_id_seq; Type: SEQUENCE; Schema: backup; Owner: vagrant
--
CREATE SEQUENCE post_action_types_id_seq
START WITH 6
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE backup.post_action_types_id_seq OWNER TO vagrant;
--
-- Name: post_action_types_id_seq; Type: SEQUENCE OWNED BY; Schema: backup; Owner: vagrant
--
ALTER SEQUENCE post_action_types_id_seq OWNED BY post_action_types.id;
--
-- Name: post_actions; Type: TABLE; Schema: backup; Owner: vagrant; Tablespace:
--
CREATE TABLE post_actions (
id integer NOT NULL,
post_id integer NOT NULL,
user_id integer NOT NULL,
post_action_type_id integer NOT NULL,
deleted_at timestamp without time zone,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
ALTER TABLE backup.post_actions OWNER TO vagrant;
--
-- Name: post_actions_id_seq; Type: SEQUENCE; Schema: backup; Owner: vagrant
--
CREATE SEQUENCE post_actions_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;