]> git.openstreetmap.org Git - rails.git/blob - db/structure.sql
5919574f45f9ba170583149b57882e547265eda9
[rails.git] / db / structure.sql
1 --
2 -- PostgreSQL database dump
3 --
4
5 -- Dumped from database version 9.5.3
6 -- Dumped by pg_dump version 9.5.3
7
8 SET statement_timeout = 0;
9 SET lock_timeout = 0;
10 SET client_encoding = 'UTF8';
11 SET standard_conforming_strings = on;
12 SET check_function_bodies = false;
13 SET client_min_messages = warning;
14 SET row_security = off;
15
16 --
17 -- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
18 --
19
20 CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
21
22
23 --
24 -- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
25 --
26
27 COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
28
29
30 --
31 -- Name: btree_gist; Type: EXTENSION; Schema: -; Owner: -
32 --
33
34 CREATE EXTENSION IF NOT EXISTS btree_gist WITH SCHEMA public;
35
36
37 --
38 -- Name: EXTENSION btree_gist; Type: COMMENT; Schema: -; Owner: -
39 --
40
41 COMMENT ON EXTENSION btree_gist IS 'support for indexing common datatypes in GiST';
42
43
44 SET search_path = public, pg_catalog;
45
46 --
47 -- Name: format_enum; Type: TYPE; Schema: public; Owner: -
48 --
49
50 CREATE TYPE format_enum AS ENUM (
51     'html',
52     'markdown',
53     'text'
54 );
55
56
57 --
58 -- Name: gpx_visibility_enum; Type: TYPE; Schema: public; Owner: -
59 --
60
61 CREATE TYPE gpx_visibility_enum AS ENUM (
62     'private',
63     'public',
64     'trackable',
65     'identifiable'
66 );
67
68
69 --
70 -- Name: note_event_enum; Type: TYPE; Schema: public; Owner: -
71 --
72
73 CREATE TYPE note_event_enum AS ENUM (
74     'opened',
75     'closed',
76     'reopened',
77     'commented',
78     'hidden'
79 );
80
81
82 --
83 -- Name: note_status_enum; Type: TYPE; Schema: public; Owner: -
84 --
85
86 CREATE TYPE note_status_enum AS ENUM (
87     'open',
88     'closed',
89     'hidden'
90 );
91
92
93 --
94 -- Name: nwr_enum; Type: TYPE; Schema: public; Owner: -
95 --
96
97 CREATE TYPE nwr_enum AS ENUM (
98     'Node',
99     'Way',
100     'Relation'
101 );
102
103
104 --
105 -- Name: user_role_enum; Type: TYPE; Schema: public; Owner: -
106 --
107
108 CREATE TYPE user_role_enum AS ENUM (
109     'administrator',
110     'moderator'
111 );
112
113
114 --
115 -- Name: user_status_enum; Type: TYPE; Schema: public; Owner: -
116 --
117
118 CREATE TYPE user_status_enum AS ENUM (
119     'pending',
120     'active',
121     'confirmed',
122     'suspended',
123     'deleted'
124 );
125
126
127 --
128 -- Name: maptile_for_point(bigint, bigint, integer); Type: FUNCTION; Schema: public; Owner: -
129 --
130
131 CREATE FUNCTION maptile_for_point(bigint, bigint, integer) RETURNS integer
132     LANGUAGE c STRICT
133     AS '$libdir/libpgosm', 'maptile_for_point';
134
135
136 --
137 -- Name: tile_for_point(integer, integer); Type: FUNCTION; Schema: public; Owner: -
138 --
139
140 CREATE FUNCTION tile_for_point(integer, integer) RETURNS bigint
141     LANGUAGE c STRICT
142     AS '$libdir/libpgosm', 'tile_for_point';
143
144
145 --
146 -- Name: xid_to_int4(xid); Type: FUNCTION; Schema: public; Owner: -
147 --
148
149 CREATE FUNCTION xid_to_int4(xid) RETURNS integer
150     LANGUAGE c IMMUTABLE STRICT
151     AS '$libdir/libpgosm', 'xid_to_int4';
152
153
154 SET default_tablespace = '';
155
156 SET default_with_oids = false;
157
158 --
159 -- Name: acls; Type: TABLE; Schema: public; Owner: -
160 --
161
162 CREATE TABLE acls (
163     id integer NOT NULL,
164     address inet,
165     k character varying(255) NOT NULL,
166     v character varying(255),
167     domain character varying(255)
168 );
169
170
171 --
172 -- Name: acls_id_seq; Type: SEQUENCE; Schema: public; Owner: -
173 --
174
175 CREATE SEQUENCE acls_id_seq
176     START WITH 1
177     INCREMENT BY 1
178     NO MINVALUE
179     NO MAXVALUE
180     CACHE 1;
181
182
183 --
184 -- Name: acls_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
185 --
186
187 ALTER SEQUENCE acls_id_seq OWNED BY acls.id;
188
189
190 --
191 -- Name: changeset_comments; Type: TABLE; Schema: public; Owner: -
192 --
193
194 CREATE TABLE changeset_comments (
195     id integer NOT NULL,
196     changeset_id bigint NOT NULL,
197     author_id bigint NOT NULL,
198     body text NOT NULL,
199     created_at timestamp without time zone NOT NULL,
200     visible boolean NOT NULL
201 );
202
203
204 --
205 -- Name: changeset_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
206 --
207
208 CREATE SEQUENCE changeset_comments_id_seq
209     START WITH 1
210     INCREMENT BY 1
211     NO MINVALUE
212     NO MAXVALUE
213     CACHE 1;
214
215
216 --
217 -- Name: changeset_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
218 --
219
220 ALTER SEQUENCE changeset_comments_id_seq OWNED BY changeset_comments.id;
221
222
223 --
224 -- Name: changeset_tags; Type: TABLE; Schema: public; Owner: -
225 --
226
227 CREATE TABLE changeset_tags (
228     changeset_id bigint NOT NULL,
229     k character varying(255) DEFAULT ''::character varying NOT NULL,
230     v character varying(255) DEFAULT ''::character varying NOT NULL
231 );
232
233
234 --
235 -- Name: changesets; Type: TABLE; Schema: public; Owner: -
236 --
237
238 CREATE TABLE changesets (
239     id bigint NOT NULL,
240     user_id bigint NOT NULL,
241     created_at timestamp without time zone NOT NULL,
242     min_lat integer,
243     max_lat integer,
244     min_lon integer,
245     max_lon integer,
246     closed_at timestamp without time zone NOT NULL,
247     num_changes integer DEFAULT 0 NOT NULL
248 );
249
250
251 --
252 -- Name: changesets_id_seq; Type: SEQUENCE; Schema: public; Owner: -
253 --
254
255 CREATE SEQUENCE changesets_id_seq
256     START WITH 1
257     INCREMENT BY 1
258     NO MINVALUE
259     NO MAXVALUE
260     CACHE 1;
261
262
263 --
264 -- Name: changesets_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
265 --
266
267 ALTER SEQUENCE changesets_id_seq OWNED BY changesets.id;
268
269
270 --
271 -- Name: changesets_subscribers; Type: TABLE; Schema: public; Owner: -
272 --
273
274 CREATE TABLE changesets_subscribers (
275     subscriber_id bigint NOT NULL,
276     changeset_id bigint NOT NULL
277 );
278
279
280 --
281 -- Name: client_applications; Type: TABLE; Schema: public; Owner: -
282 --
283
284 CREATE TABLE client_applications (
285     id integer NOT NULL,
286     name character varying(255),
287     url character varying(255),
288     support_url character varying(255),
289     callback_url character varying(255),
290     key character varying(50),
291     secret character varying(50),
292     user_id integer,
293     created_at timestamp without time zone,
294     updated_at timestamp without time zone,
295     allow_read_prefs boolean DEFAULT false NOT NULL,
296     allow_write_prefs boolean DEFAULT false NOT NULL,
297     allow_write_diary boolean DEFAULT false NOT NULL,
298     allow_write_api boolean DEFAULT false NOT NULL,
299     allow_read_gpx boolean DEFAULT false NOT NULL,
300     allow_write_gpx boolean DEFAULT false NOT NULL,
301     allow_write_notes boolean DEFAULT false NOT NULL
302 );
303
304
305 --
306 -- Name: client_applications_id_seq; Type: SEQUENCE; Schema: public; Owner: -
307 --
308
309 CREATE SEQUENCE client_applications_id_seq
310     START WITH 1
311     INCREMENT BY 1
312     NO MINVALUE
313     NO MAXVALUE
314     CACHE 1;
315
316
317 --
318 -- Name: client_applications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
319 --
320
321 ALTER SEQUENCE client_applications_id_seq OWNED BY client_applications.id;
322
323
324 --
325 -- Name: current_node_tags; Type: TABLE; Schema: public; Owner: -
326 --
327
328 CREATE TABLE current_node_tags (
329     node_id bigint NOT NULL,
330     k character varying(255) DEFAULT ''::character varying NOT NULL,
331     v character varying(255) DEFAULT ''::character varying NOT NULL
332 );
333
334
335 --
336 -- Name: current_nodes; Type: TABLE; Schema: public; Owner: -
337 --
338
339 CREATE TABLE current_nodes (
340     id bigint NOT NULL,
341     latitude integer NOT NULL,
342     longitude integer NOT NULL,
343     changeset_id bigint NOT NULL,
344     visible boolean NOT NULL,
345     "timestamp" timestamp without time zone NOT NULL,
346     tile bigint NOT NULL,
347     version bigint NOT NULL
348 );
349
350
351 --
352 -- Name: current_nodes_id_seq; Type: SEQUENCE; Schema: public; Owner: -
353 --
354
355 CREATE SEQUENCE current_nodes_id_seq
356     START WITH 1
357     INCREMENT BY 1
358     NO MINVALUE
359     NO MAXVALUE
360     CACHE 1;
361
362
363 --
364 -- Name: current_nodes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
365 --
366
367 ALTER SEQUENCE current_nodes_id_seq OWNED BY current_nodes.id;
368
369
370 --
371 -- Name: current_relation_members; Type: TABLE; Schema: public; Owner: -
372 --
373
374 CREATE TABLE current_relation_members (
375     relation_id bigint NOT NULL,
376     member_type nwr_enum NOT NULL,
377     member_id bigint NOT NULL,
378     member_role character varying(255) NOT NULL,
379     sequence_id integer DEFAULT 0 NOT NULL
380 );
381
382
383 --
384 -- Name: current_relation_tags; Type: TABLE; Schema: public; Owner: -
385 --
386
387 CREATE TABLE current_relation_tags (
388     relation_id bigint NOT NULL,
389     k character varying(255) DEFAULT ''::character varying NOT NULL,
390     v character varying(255) DEFAULT ''::character varying NOT NULL
391 );
392
393
394 --
395 -- Name: current_relations; Type: TABLE; Schema: public; Owner: -
396 --
397
398 CREATE TABLE current_relations (
399     id bigint NOT NULL,
400     changeset_id bigint NOT NULL,
401     "timestamp" timestamp without time zone NOT NULL,
402     visible boolean NOT NULL,
403     version bigint NOT NULL
404 );
405
406
407 --
408 -- Name: current_relations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
409 --
410
411 CREATE SEQUENCE current_relations_id_seq
412     START WITH 1
413     INCREMENT BY 1
414     NO MINVALUE
415     NO MAXVALUE
416     CACHE 1;
417
418
419 --
420 -- Name: current_relations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
421 --
422
423 ALTER SEQUENCE current_relations_id_seq OWNED BY current_relations.id;
424
425
426 --
427 -- Name: current_way_nodes; Type: TABLE; Schema: public; Owner: -
428 --
429
430 CREATE TABLE current_way_nodes (
431     way_id bigint NOT NULL,
432     node_id bigint NOT NULL,
433     sequence_id bigint NOT NULL
434 );
435
436
437 --
438 -- Name: current_way_tags; Type: TABLE; Schema: public; Owner: -
439 --
440
441 CREATE TABLE current_way_tags (
442     way_id bigint NOT NULL,
443     k character varying(255) DEFAULT ''::character varying NOT NULL,
444     v character varying(255) DEFAULT ''::character varying NOT NULL
445 );
446
447
448 --
449 -- Name: current_ways; Type: TABLE; Schema: public; Owner: -
450 --
451
452 CREATE TABLE current_ways (
453     id bigint NOT NULL,
454     changeset_id bigint NOT NULL,
455     "timestamp" timestamp without time zone NOT NULL,
456     visible boolean NOT NULL,
457     version bigint NOT NULL
458 );
459
460
461 --
462 -- Name: current_ways_id_seq; Type: SEQUENCE; Schema: public; Owner: -
463 --
464
465 CREATE SEQUENCE current_ways_id_seq
466     START WITH 1
467     INCREMENT BY 1
468     NO MINVALUE
469     NO MAXVALUE
470     CACHE 1;
471
472
473 --
474 -- Name: current_ways_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
475 --
476
477 ALTER SEQUENCE current_ways_id_seq OWNED BY current_ways.id;
478
479
480 --
481 -- Name: diary_comments; Type: TABLE; Schema: public; Owner: -
482 --
483
484 CREATE TABLE diary_comments (
485     id bigint NOT NULL,
486     diary_entry_id bigint NOT NULL,
487     user_id bigint NOT NULL,
488     body text NOT NULL,
489     created_at timestamp without time zone NOT NULL,
490     updated_at timestamp without time zone NOT NULL,
491     visible boolean DEFAULT true NOT NULL,
492     body_format format_enum DEFAULT 'markdown'::format_enum NOT NULL
493 );
494
495
496 --
497 -- Name: diary_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
498 --
499
500 CREATE SEQUENCE diary_comments_id_seq
501     START WITH 1
502     INCREMENT BY 1
503     NO MINVALUE
504     NO MAXVALUE
505     CACHE 1;
506
507
508 --
509 -- Name: diary_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
510 --
511
512 ALTER SEQUENCE diary_comments_id_seq OWNED BY diary_comments.id;
513
514
515 --
516 -- Name: diary_entries; Type: TABLE; Schema: public; Owner: -
517 --
518
519 CREATE TABLE diary_entries (
520     id bigint NOT NULL,
521     user_id bigint NOT NULL,
522     title character varying(255) NOT NULL,
523     body text NOT NULL,
524     created_at timestamp without time zone NOT NULL,
525     updated_at timestamp without time zone NOT NULL,
526     latitude double precision,
527     longitude double precision,
528     language_code character varying(255) DEFAULT 'en'::character varying NOT NULL,
529     visible boolean DEFAULT true NOT NULL,
530     body_format format_enum DEFAULT 'markdown'::format_enum NOT NULL
531 );
532
533
534 --
535 -- Name: diary_entries_id_seq; Type: SEQUENCE; Schema: public; Owner: -
536 --
537
538 CREATE SEQUENCE diary_entries_id_seq
539     START WITH 1
540     INCREMENT BY 1
541     NO MINVALUE
542     NO MAXVALUE
543     CACHE 1;
544
545
546 --
547 -- Name: diary_entries_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
548 --
549
550 ALTER SEQUENCE diary_entries_id_seq OWNED BY diary_entries.id;
551
552
553 --
554 -- Name: friends; Type: TABLE; Schema: public; Owner: -
555 --
556
557 CREATE TABLE friends (
558     id bigint NOT NULL,
559     user_id bigint NOT NULL,
560     friend_user_id bigint NOT NULL
561 );
562
563
564 --
565 -- Name: friends_id_seq; Type: SEQUENCE; Schema: public; Owner: -
566 --
567
568 CREATE SEQUENCE friends_id_seq
569     START WITH 1
570     INCREMENT BY 1
571     NO MINVALUE
572     NO MAXVALUE
573     CACHE 1;
574
575
576 --
577 -- Name: friends_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
578 --
579
580 ALTER SEQUENCE friends_id_seq OWNED BY friends.id;
581
582
583 --
584 -- Name: gps_points; Type: TABLE; Schema: public; Owner: -
585 --
586
587 CREATE TABLE gps_points (
588     altitude double precision,
589     trackid integer NOT NULL,
590     latitude integer NOT NULL,
591     longitude integer NOT NULL,
592     gpx_id bigint NOT NULL,
593     "timestamp" timestamp without time zone,
594     tile bigint
595 );
596
597
598 --
599 -- Name: gpx_file_tags; Type: TABLE; Schema: public; Owner: -
600 --
601
602 CREATE TABLE gpx_file_tags (
603     gpx_id bigint DEFAULT 0 NOT NULL,
604     tag character varying(255) NOT NULL,
605     id bigint NOT NULL
606 );
607
608
609 --
610 -- Name: gpx_file_tags_id_seq; Type: SEQUENCE; Schema: public; Owner: -
611 --
612
613 CREATE SEQUENCE gpx_file_tags_id_seq
614     START WITH 1
615     INCREMENT BY 1
616     NO MINVALUE
617     NO MAXVALUE
618     CACHE 1;
619
620
621 --
622 -- Name: gpx_file_tags_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
623 --
624
625 ALTER SEQUENCE gpx_file_tags_id_seq OWNED BY gpx_file_tags.id;
626
627
628 --
629 -- Name: gpx_files; Type: TABLE; Schema: public; Owner: -
630 --
631
632 CREATE TABLE gpx_files (
633     id bigint NOT NULL,
634     user_id bigint NOT NULL,
635     visible boolean DEFAULT true NOT NULL,
636     name character varying(255) DEFAULT ''::character varying NOT NULL,
637     size bigint,
638     latitude double precision,
639     longitude double precision,
640     "timestamp" timestamp without time zone NOT NULL,
641     description character varying(255) DEFAULT ''::character varying NOT NULL,
642     inserted boolean NOT NULL,
643     visibility gpx_visibility_enum DEFAULT 'public'::gpx_visibility_enum NOT NULL
644 );
645
646
647 --
648 -- Name: gpx_files_id_seq; Type: SEQUENCE; Schema: public; Owner: -
649 --
650
651 CREATE SEQUENCE gpx_files_id_seq
652     START WITH 1
653     INCREMENT BY 1
654     NO MINVALUE
655     NO MAXVALUE
656     CACHE 1;
657
658
659 --
660 -- Name: gpx_files_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
661 --
662
663 ALTER SEQUENCE gpx_files_id_seq OWNED BY gpx_files.id;
664
665
666 --
667 -- Name: issue_comments; Type: TABLE; Schema: public; Owner: -; Tablespace: 
668 --
669
670 CREATE TABLE issue_comments (
671     id integer NOT NULL,
672     issue_id integer,
673     commenter_user_id integer,
674     body text,
675     created_at timestamp without time zone NOT NULL,
676     reassign boolean,
677     updated_at timestamp without time zone NOT NULL
678 );
679
680
681 --
682 -- Name: issue_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
683 --
684
685 CREATE SEQUENCE issue_comments_id_seq
686     START WITH 1
687     INCREMENT BY 1
688     NO MINVALUE
689     NO MAXVALUE
690     CACHE 1;
691
692
693 --
694 -- Name: issue_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
695 --
696
697 ALTER SEQUENCE issue_comments_id_seq OWNED BY issue_comments.id;
698
699
700 --
701 -- Name: issues; Type: TABLE; Schema: public; Owner: -; Tablespace: 
702 --
703
704 CREATE TABLE issues (
705     id integer NOT NULL,
706     reportable_type character varying NOT NULL,
707     reportable_id integer NOT NULL,
708     reported_user_id integer NOT NULL,
709     status integer,
710     issue_type character varying,
711     resolved_at timestamp without time zone,
712     resolved_by integer,
713     created_at timestamp without time zone NOT NULL,
714     updated_at timestamp without time zone NOT NULL,
715     updated_by integer
716 );
717
718
719 --
720 -- Name: issues_id_seq; Type: SEQUENCE; Schema: public; Owner: -
721 --
722
723 CREATE SEQUENCE issues_id_seq
724     START WITH 1
725     INCREMENT BY 1
726     NO MINVALUE
727     NO MAXVALUE
728     CACHE 1;
729
730
731 --
732 -- Name: issues_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
733 --
734
735 ALTER SEQUENCE issues_id_seq OWNED BY issues.id;
736
737
738 --
739 -- Name: languages; Type: TABLE; Schema: public; Owner: -
740 --
741
742 CREATE TABLE languages (
743     code character varying(255) NOT NULL,
744     english_name character varying(255) NOT NULL,
745     native_name character varying(255)
746 );
747
748
749 --
750 -- Name: messages; Type: TABLE; Schema: public; Owner: -
751 --
752
753 CREATE TABLE messages (
754     id bigint NOT NULL,
755     from_user_id bigint NOT NULL,
756     title character varying(255) NOT NULL,
757     body text NOT NULL,
758     sent_on timestamp without time zone NOT NULL,
759     message_read boolean DEFAULT false NOT NULL,
760     to_user_id bigint NOT NULL,
761     to_user_visible boolean DEFAULT true NOT NULL,
762     from_user_visible boolean DEFAULT true NOT NULL,
763     body_format format_enum DEFAULT 'markdown'::format_enum NOT NULL
764 );
765
766
767 --
768 -- Name: messages_id_seq; Type: SEQUENCE; Schema: public; Owner: -
769 --
770
771 CREATE SEQUENCE messages_id_seq
772     START WITH 1
773     INCREMENT BY 1
774     NO MINVALUE
775     NO MAXVALUE
776     CACHE 1;
777
778
779 --
780 -- Name: messages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
781 --
782
783 ALTER SEQUENCE messages_id_seq OWNED BY messages.id;
784
785
786 --
787 -- Name: node_tags; Type: TABLE; Schema: public; Owner: -
788 --
789
790 CREATE TABLE node_tags (
791     node_id bigint NOT NULL,
792     version bigint NOT NULL,
793     k character varying(255) DEFAULT ''::character varying NOT NULL,
794     v character varying(255) DEFAULT ''::character varying NOT NULL
795 );
796
797
798 --
799 -- Name: nodes; Type: TABLE; Schema: public; Owner: -
800 --
801
802 CREATE TABLE nodes (
803     node_id bigint NOT NULL,
804     latitude integer NOT NULL,
805     longitude integer NOT NULL,
806     changeset_id bigint NOT NULL,
807     visible boolean NOT NULL,
808     "timestamp" timestamp without time zone NOT NULL,
809     tile bigint NOT NULL,
810     version bigint NOT NULL,
811     redaction_id integer
812 );
813
814
815 --
816 -- Name: note_comments; Type: TABLE; Schema: public; Owner: -
817 --
818
819 CREATE TABLE note_comments (
820     id integer NOT NULL,
821     note_id bigint NOT NULL,
822     visible boolean NOT NULL,
823     created_at timestamp without time zone NOT NULL,
824     author_ip inet,
825     author_id bigint,
826     body text,
827     event note_event_enum
828 );
829
830
831 --
832 -- Name: note_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
833 --
834
835 CREATE SEQUENCE note_comments_id_seq
836     START WITH 1
837     INCREMENT BY 1
838     NO MINVALUE
839     NO MAXVALUE
840     CACHE 1;
841
842
843 --
844 -- Name: note_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
845 --
846
847 ALTER SEQUENCE note_comments_id_seq OWNED BY note_comments.id;
848
849
850 --
851 -- Name: notes; Type: TABLE; Schema: public; Owner: -
852 --
853
854 CREATE TABLE notes (
855     id integer NOT NULL,
856     latitude integer NOT NULL,
857     longitude integer NOT NULL,
858     tile bigint NOT NULL,
859     updated_at timestamp without time zone NOT NULL,
860     created_at timestamp without time zone NOT NULL,
861     status note_status_enum NOT NULL,
862     closed_at timestamp without time zone
863 );
864
865
866 --
867 -- Name: notes_id_seq; Type: SEQUENCE; Schema: public; Owner: -
868 --
869
870 CREATE SEQUENCE notes_id_seq
871     START WITH 1
872     INCREMENT BY 1
873     NO MINVALUE
874     NO MAXVALUE
875     CACHE 1;
876
877
878 --
879 -- Name: notes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
880 --
881
882 ALTER SEQUENCE notes_id_seq OWNED BY notes.id;
883
884
885 --
886 -- Name: oauth_nonces; Type: TABLE; Schema: public; Owner: -
887 --
888
889 CREATE TABLE oauth_nonces (
890     id integer NOT NULL,
891     nonce character varying(255),
892     "timestamp" integer,
893     created_at timestamp without time zone,
894     updated_at timestamp without time zone
895 );
896
897
898 --
899 -- Name: oauth_nonces_id_seq; Type: SEQUENCE; Schema: public; Owner: -
900 --
901
902 CREATE SEQUENCE oauth_nonces_id_seq
903     START WITH 1
904     INCREMENT BY 1
905     NO MINVALUE
906     NO MAXVALUE
907     CACHE 1;
908
909
910 --
911 -- Name: oauth_nonces_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
912 --
913
914 ALTER SEQUENCE oauth_nonces_id_seq OWNED BY oauth_nonces.id;
915
916
917 --
918 -- Name: oauth_tokens; Type: TABLE; Schema: public; Owner: -
919 --
920
921 CREATE TABLE oauth_tokens (
922     id integer NOT NULL,
923     user_id integer,
924     type character varying(20),
925     client_application_id integer,
926     token character varying(50),
927     secret character varying(50),
928     authorized_at timestamp without time zone,
929     invalidated_at timestamp without time zone,
930     created_at timestamp without time zone,
931     updated_at timestamp without time zone,
932     allow_read_prefs boolean DEFAULT false NOT NULL,
933     allow_write_prefs boolean DEFAULT false NOT NULL,
934     allow_write_diary boolean DEFAULT false NOT NULL,
935     allow_write_api boolean DEFAULT false NOT NULL,
936     allow_read_gpx boolean DEFAULT false NOT NULL,
937     allow_write_gpx boolean DEFAULT false NOT NULL,
938     callback_url character varying(255),
939     verifier character varying(20),
940     scope character varying(255),
941     valid_to timestamp without time zone,
942     allow_write_notes boolean DEFAULT false NOT NULL
943 );
944
945
946 --
947 -- Name: oauth_tokens_id_seq; Type: SEQUENCE; Schema: public; Owner: -
948 --
949
950 CREATE SEQUENCE oauth_tokens_id_seq
951     START WITH 1
952     INCREMENT BY 1
953     NO MINVALUE
954     NO MAXVALUE
955     CACHE 1;
956
957
958 --
959 -- Name: oauth_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
960 --
961
962 ALTER SEQUENCE oauth_tokens_id_seq OWNED BY oauth_tokens.id;
963
964
965 --
966 -- Name: redactions; Type: TABLE; Schema: public; Owner: -
967 --
968
969 CREATE TABLE redactions (
970     id integer NOT NULL,
971     title character varying(255),
972     description text,
973     created_at timestamp without time zone NOT NULL,
974     updated_at timestamp without time zone NOT NULL,
975     user_id bigint NOT NULL,
976     description_format format_enum DEFAULT 'markdown'::format_enum NOT NULL
977 );
978
979
980 --
981 -- Name: redactions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
982 --
983
984 CREATE SEQUENCE redactions_id_seq
985     START WITH 1
986     INCREMENT BY 1
987     NO MINVALUE
988     NO MAXVALUE
989     CACHE 1;
990
991
992 --
993 -- Name: redactions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
994 --
995
996 ALTER SEQUENCE redactions_id_seq OWNED BY redactions.id;
997
998
999 --
1000 -- Name: relation_members; Type: TABLE; Schema: public; Owner: -
1001 --
1002
1003 CREATE TABLE relation_members (
1004     relation_id bigint DEFAULT 0 NOT NULL,
1005     member_type nwr_enum NOT NULL,
1006     member_id bigint NOT NULL,
1007     member_role character varying(255) NOT NULL,
1008     version bigint DEFAULT 0 NOT NULL,
1009     sequence_id integer DEFAULT 0 NOT NULL
1010 );
1011
1012
1013 --
1014 -- Name: relation_tags; Type: TABLE; Schema: public; Owner: -
1015 --
1016
1017 CREATE TABLE relation_tags (
1018     relation_id bigint DEFAULT 0 NOT NULL,
1019     k character varying(255) DEFAULT ''::character varying NOT NULL,
1020     v character varying(255) DEFAULT ''::character varying NOT NULL,
1021     version bigint NOT NULL
1022 );
1023
1024
1025 --
1026 -- Name: relations; Type: TABLE; Schema: public; Owner: -
1027 --
1028
1029 CREATE TABLE relations (
1030     relation_id bigint DEFAULT 0 NOT NULL,
1031     changeset_id bigint NOT NULL,
1032     "timestamp" timestamp without time zone NOT NULL,
1033     version bigint NOT NULL,
1034     visible boolean DEFAULT true NOT NULL,
1035     redaction_id integer
1036 );
1037
1038
1039 --
1040 -- Name: reports; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1041 --
1042
1043 CREATE TABLE reports (
1044     id integer NOT NULL,
1045     issue_id integer,
1046     reporter_user_id integer,
1047     details text,
1048     created_at timestamp without time zone NOT NULL,
1049     updated_at timestamp without time zone NOT NULL
1050 );
1051
1052
1053 --
1054 -- Name: reports_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1055 --
1056
1057 CREATE SEQUENCE reports_id_seq
1058     START WITH 1
1059     INCREMENT BY 1
1060     NO MINVALUE
1061     NO MAXVALUE
1062     CACHE 1;
1063
1064
1065 --
1066 -- Name: reports_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1067 --
1068
1069 ALTER SEQUENCE reports_id_seq OWNED BY reports.id;
1070
1071
1072 --
1073 -- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -
1074 --
1075
1076 CREATE TABLE schema_migrations (
1077     version character varying(255) NOT NULL
1078 );
1079
1080
1081 --
1082 -- Name: user_blocks; Type: TABLE; Schema: public; Owner: -
1083 --
1084
1085 CREATE TABLE user_blocks (
1086     id integer NOT NULL,
1087     user_id bigint NOT NULL,
1088     creator_id bigint NOT NULL,
1089     reason text NOT NULL,
1090     ends_at timestamp without time zone NOT NULL,
1091     needs_view boolean DEFAULT false NOT NULL,
1092     revoker_id bigint,
1093     created_at timestamp without time zone,
1094     updated_at timestamp without time zone,
1095     reason_format format_enum DEFAULT 'markdown'::format_enum NOT NULL
1096 );
1097
1098
1099 --
1100 -- Name: user_blocks_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1101 --
1102
1103 CREATE SEQUENCE user_blocks_id_seq
1104     START WITH 1
1105     INCREMENT BY 1
1106     NO MINVALUE
1107     NO MAXVALUE
1108     CACHE 1;
1109
1110
1111 --
1112 -- Name: user_blocks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1113 --
1114
1115 ALTER SEQUENCE user_blocks_id_seq OWNED BY user_blocks.id;
1116
1117
1118 --
1119 -- Name: user_preferences; Type: TABLE; Schema: public; Owner: -
1120 --
1121
1122 CREATE TABLE user_preferences (
1123     user_id bigint NOT NULL,
1124     k character varying(255) NOT NULL,
1125     v character varying(255) NOT NULL
1126 );
1127
1128
1129 --
1130 -- Name: user_roles; Type: TABLE; Schema: public; Owner: -
1131 --
1132
1133 CREATE TABLE user_roles (
1134     id integer NOT NULL,
1135     user_id bigint NOT NULL,
1136     created_at timestamp without time zone,
1137     updated_at timestamp without time zone,
1138     role user_role_enum NOT NULL,
1139     granter_id bigint NOT NULL
1140 );
1141
1142
1143 --
1144 -- Name: user_roles_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1145 --
1146
1147 CREATE SEQUENCE user_roles_id_seq
1148     START WITH 1
1149     INCREMENT BY 1
1150     NO MINVALUE
1151     NO MAXVALUE
1152     CACHE 1;
1153
1154
1155 --
1156 -- Name: user_roles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1157 --
1158
1159 ALTER SEQUENCE user_roles_id_seq OWNED BY user_roles.id;
1160
1161
1162 --
1163 -- Name: user_tokens; Type: TABLE; Schema: public; Owner: -
1164 --
1165
1166 CREATE TABLE user_tokens (
1167     id bigint NOT NULL,
1168     user_id bigint NOT NULL,
1169     token character varying(255) NOT NULL,
1170     expiry timestamp without time zone NOT NULL,
1171     referer text
1172 );
1173
1174
1175 --
1176 -- Name: user_tokens_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1177 --
1178
1179 CREATE SEQUENCE user_tokens_id_seq
1180     START WITH 1
1181     INCREMENT BY 1
1182     NO MINVALUE
1183     NO MAXVALUE
1184     CACHE 1;
1185
1186
1187 --
1188 -- Name: user_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1189 --
1190
1191 ALTER SEQUENCE user_tokens_id_seq OWNED BY user_tokens.id;
1192
1193
1194 --
1195 -- Name: users; Type: TABLE; Schema: public; Owner: -
1196 --
1197
1198 CREATE TABLE users (
1199     email character varying(255) NOT NULL,
1200     id bigint NOT NULL,
1201     pass_crypt character varying(255) NOT NULL,
1202     creation_time timestamp without time zone NOT NULL,
1203     display_name character varying(255) DEFAULT ''::character varying NOT NULL,
1204     data_public boolean DEFAULT false NOT NULL,
1205     description text DEFAULT ''::text NOT NULL,
1206     home_lat double precision,
1207     home_lon double precision,
1208     home_zoom smallint DEFAULT 3,
1209     nearby integer DEFAULT 50,
1210     pass_salt character varying(255),
1211     image_file_name text,
1212     email_valid boolean DEFAULT false NOT NULL,
1213     new_email character varying(255),
1214     creation_ip character varying(255),
1215     languages character varying(255),
1216     status user_status_enum DEFAULT 'pending'::user_status_enum NOT NULL,
1217     terms_agreed timestamp without time zone,
1218     consider_pd boolean DEFAULT false NOT NULL,
1219     preferred_editor character varying(255),
1220     terms_seen boolean DEFAULT false NOT NULL,
1221     auth_uid character varying(255),
1222     description_format format_enum DEFAULT 'markdown'::format_enum NOT NULL,
1223     image_fingerprint character varying(255),
1224     changesets_count integer DEFAULT 0 NOT NULL,
1225     traces_count integer DEFAULT 0 NOT NULL,
1226     diary_entries_count integer DEFAULT 0 NOT NULL,
1227     image_use_gravatar boolean DEFAULT false NOT NULL,
1228     image_content_type character varying(255),
1229     auth_provider character varying
1230 );
1231
1232
1233 --
1234 -- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1235 --
1236
1237 CREATE SEQUENCE users_id_seq
1238     START WITH 1
1239     INCREMENT BY 1
1240     NO MINVALUE
1241     NO MAXVALUE
1242     CACHE 1;
1243
1244
1245 --
1246 -- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1247 --
1248
1249 ALTER SEQUENCE users_id_seq OWNED BY users.id;
1250
1251
1252 --
1253 -- Name: way_nodes; Type: TABLE; Schema: public; Owner: -
1254 --
1255
1256 CREATE TABLE way_nodes (
1257     way_id bigint NOT NULL,
1258     node_id bigint NOT NULL,
1259     version bigint NOT NULL,
1260     sequence_id bigint NOT NULL
1261 );
1262
1263
1264 --
1265 -- Name: way_tags; Type: TABLE; Schema: public; Owner: -
1266 --
1267
1268 CREATE TABLE way_tags (
1269     way_id bigint DEFAULT 0 NOT NULL,
1270     k character varying(255) NOT NULL,
1271     v character varying(255) NOT NULL,
1272     version bigint NOT NULL
1273 );
1274
1275
1276 --
1277 -- Name: ways; Type: TABLE; Schema: public; Owner: -
1278 --
1279
1280 CREATE TABLE ways (
1281     way_id bigint DEFAULT 0 NOT NULL,
1282     changeset_id bigint NOT NULL,
1283     "timestamp" timestamp without time zone NOT NULL,
1284     version bigint NOT NULL,
1285     visible boolean DEFAULT true NOT NULL,
1286     redaction_id integer
1287 );
1288
1289
1290 --
1291 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1292 --
1293
1294 ALTER TABLE ONLY acls ALTER COLUMN id SET DEFAULT nextval('acls_id_seq'::regclass);
1295
1296
1297 --
1298 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1299 --
1300
1301 ALTER TABLE ONLY changeset_comments ALTER COLUMN id SET DEFAULT nextval('changeset_comments_id_seq'::regclass);
1302
1303
1304 --
1305 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1306 --
1307
1308 ALTER TABLE ONLY changesets ALTER COLUMN id SET DEFAULT nextval('changesets_id_seq'::regclass);
1309
1310
1311 --
1312 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1313 --
1314
1315 ALTER TABLE ONLY client_applications ALTER COLUMN id SET DEFAULT nextval('client_applications_id_seq'::regclass);
1316
1317
1318 --
1319 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1320 --
1321
1322 ALTER TABLE ONLY current_nodes ALTER COLUMN id SET DEFAULT nextval('current_nodes_id_seq'::regclass);
1323
1324
1325 --
1326 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1327 --
1328
1329 ALTER TABLE ONLY current_relations ALTER COLUMN id SET DEFAULT nextval('current_relations_id_seq'::regclass);
1330
1331
1332 --
1333 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1334 --
1335
1336 ALTER TABLE ONLY current_ways ALTER COLUMN id SET DEFAULT nextval('current_ways_id_seq'::regclass);
1337
1338
1339 --
1340 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1341 --
1342
1343 ALTER TABLE ONLY diary_comments ALTER COLUMN id SET DEFAULT nextval('diary_comments_id_seq'::regclass);
1344
1345
1346 --
1347 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1348 --
1349
1350 ALTER TABLE ONLY diary_entries ALTER COLUMN id SET DEFAULT nextval('diary_entries_id_seq'::regclass);
1351
1352
1353 --
1354 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1355 --
1356
1357 ALTER TABLE ONLY friends ALTER COLUMN id SET DEFAULT nextval('friends_id_seq'::regclass);
1358
1359
1360 --
1361 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1362 --
1363
1364 ALTER TABLE ONLY gpx_file_tags ALTER COLUMN id SET DEFAULT nextval('gpx_file_tags_id_seq'::regclass);
1365
1366
1367 --
1368 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1369 --
1370
1371 ALTER TABLE ONLY gpx_files ALTER COLUMN id SET DEFAULT nextval('gpx_files_id_seq'::regclass);
1372
1373
1374 --
1375 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1376 --
1377
1378 ALTER TABLE ONLY issue_comments ALTER COLUMN id SET DEFAULT nextval('issue_comments_id_seq'::regclass);
1379
1380
1381 --
1382 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1383 --
1384
1385 ALTER TABLE ONLY issues ALTER COLUMN id SET DEFAULT nextval('issues_id_seq'::regclass);
1386
1387
1388 --
1389 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1390 --
1391
1392 ALTER TABLE ONLY messages ALTER COLUMN id SET DEFAULT nextval('messages_id_seq'::regclass);
1393
1394
1395 --
1396 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1397 --
1398
1399 ALTER TABLE ONLY note_comments ALTER COLUMN id SET DEFAULT nextval('note_comments_id_seq'::regclass);
1400
1401
1402 --
1403 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1404 --
1405
1406 ALTER TABLE ONLY notes ALTER COLUMN id SET DEFAULT nextval('notes_id_seq'::regclass);
1407
1408
1409 --
1410 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1411 --
1412
1413 ALTER TABLE ONLY oauth_nonces ALTER COLUMN id SET DEFAULT nextval('oauth_nonces_id_seq'::regclass);
1414
1415
1416 --
1417 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1418 --
1419
1420 ALTER TABLE ONLY oauth_tokens ALTER COLUMN id SET DEFAULT nextval('oauth_tokens_id_seq'::regclass);
1421
1422
1423 --
1424 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1425 --
1426
1427 ALTER TABLE ONLY redactions ALTER COLUMN id SET DEFAULT nextval('redactions_id_seq'::regclass);
1428
1429
1430 --
1431 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1432 --
1433
1434 ALTER TABLE ONLY reports ALTER COLUMN id SET DEFAULT nextval('reports_id_seq'::regclass);
1435
1436
1437 --
1438 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1439 --
1440
1441 ALTER TABLE ONLY user_blocks ALTER COLUMN id SET DEFAULT nextval('user_blocks_id_seq'::regclass);
1442
1443
1444 --
1445 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1446 --
1447
1448 ALTER TABLE ONLY user_roles ALTER COLUMN id SET DEFAULT nextval('user_roles_id_seq'::regclass);
1449
1450
1451 --
1452 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1453 --
1454
1455 ALTER TABLE ONLY user_tokens ALTER COLUMN id SET DEFAULT nextval('user_tokens_id_seq'::regclass);
1456
1457
1458 --
1459 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1460 --
1461
1462 ALTER TABLE ONLY users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass);
1463
1464
1465 --
1466 -- Name: acls_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1467 --
1468
1469 ALTER TABLE ONLY acls
1470     ADD CONSTRAINT acls_pkey PRIMARY KEY (id);
1471
1472
1473 --
1474 -- Name: changeset_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1475 --
1476
1477 ALTER TABLE ONLY changeset_comments
1478     ADD CONSTRAINT changeset_comments_pkey PRIMARY KEY (id);
1479
1480
1481 --
1482 -- Name: changesets_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1483 --
1484
1485 ALTER TABLE ONLY changesets
1486     ADD CONSTRAINT changesets_pkey PRIMARY KEY (id);
1487
1488
1489 --
1490 -- Name: client_applications_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1491 --
1492
1493 ALTER TABLE ONLY client_applications
1494     ADD CONSTRAINT client_applications_pkey PRIMARY KEY (id);
1495
1496
1497 --
1498 -- Name: current_node_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1499 --
1500
1501 ALTER TABLE ONLY current_node_tags
1502     ADD CONSTRAINT current_node_tags_pkey PRIMARY KEY (node_id, k);
1503
1504
1505 --
1506 -- Name: current_nodes_pkey1; Type: CONSTRAINT; Schema: public; Owner: -
1507 --
1508
1509 ALTER TABLE ONLY current_nodes
1510     ADD CONSTRAINT current_nodes_pkey1 PRIMARY KEY (id);
1511
1512
1513 --
1514 -- Name: current_relation_members_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1515 --
1516
1517 ALTER TABLE ONLY current_relation_members
1518     ADD CONSTRAINT current_relation_members_pkey PRIMARY KEY (relation_id, member_type, member_id, member_role, sequence_id);
1519
1520
1521 --
1522 -- Name: current_relation_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1523 --
1524
1525 ALTER TABLE ONLY current_relation_tags
1526     ADD CONSTRAINT current_relation_tags_pkey PRIMARY KEY (relation_id, k);
1527
1528
1529 --
1530 -- Name: current_relations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1531 --
1532
1533 ALTER TABLE ONLY current_relations
1534     ADD CONSTRAINT current_relations_pkey PRIMARY KEY (id);
1535
1536
1537 --
1538 -- Name: current_way_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1539 --
1540
1541 ALTER TABLE ONLY current_way_nodes
1542     ADD CONSTRAINT current_way_nodes_pkey PRIMARY KEY (way_id, sequence_id);
1543
1544
1545 --
1546 -- Name: current_way_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1547 --
1548
1549 ALTER TABLE ONLY current_way_tags
1550     ADD CONSTRAINT current_way_tags_pkey PRIMARY KEY (way_id, k);
1551
1552
1553 --
1554 -- Name: current_ways_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1555 --
1556
1557 ALTER TABLE ONLY current_ways
1558     ADD CONSTRAINT current_ways_pkey PRIMARY KEY (id);
1559
1560
1561 --
1562 -- Name: diary_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1563 --
1564
1565 ALTER TABLE ONLY diary_comments
1566     ADD CONSTRAINT diary_comments_pkey PRIMARY KEY (id);
1567
1568
1569 --
1570 -- Name: diary_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1571 --
1572
1573 ALTER TABLE ONLY diary_entries
1574     ADD CONSTRAINT diary_entries_pkey PRIMARY KEY (id);
1575
1576
1577 --
1578 -- Name: friends_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1579 --
1580
1581 ALTER TABLE ONLY friends
1582     ADD CONSTRAINT friends_pkey PRIMARY KEY (id);
1583
1584
1585 --
1586 -- Name: gpx_file_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1587 --
1588
1589 ALTER TABLE ONLY gpx_file_tags
1590     ADD CONSTRAINT gpx_file_tags_pkey PRIMARY KEY (id);
1591
1592
1593 --
1594 -- Name: gpx_files_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1595 --
1596
1597 ALTER TABLE ONLY gpx_files
1598     ADD CONSTRAINT gpx_files_pkey PRIMARY KEY (id);
1599
1600
1601 --
1602 -- Name: issue_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
1603 --
1604
1605 ALTER TABLE ONLY issue_comments
1606     ADD CONSTRAINT issue_comments_pkey PRIMARY KEY (id);
1607
1608
1609 --
1610 -- Name: issues_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
1611 --
1612
1613 ALTER TABLE ONLY issues
1614     ADD CONSTRAINT issues_pkey PRIMARY KEY (id);
1615
1616
1617 --
1618 -- Name: languages_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1619 --
1620
1621 ALTER TABLE ONLY languages
1622     ADD CONSTRAINT languages_pkey PRIMARY KEY (code);
1623
1624
1625 --
1626 -- Name: messages_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1627 --
1628
1629 ALTER TABLE ONLY messages
1630     ADD CONSTRAINT messages_pkey PRIMARY KEY (id);
1631
1632
1633 --
1634 -- Name: node_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1635 --
1636
1637 ALTER TABLE ONLY node_tags
1638     ADD CONSTRAINT node_tags_pkey PRIMARY KEY (node_id, version, k);
1639
1640
1641 --
1642 -- Name: nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1643 --
1644
1645 ALTER TABLE ONLY nodes
1646     ADD CONSTRAINT nodes_pkey PRIMARY KEY (node_id, version);
1647
1648
1649 --
1650 -- Name: note_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1651 --
1652
1653 ALTER TABLE ONLY note_comments
1654     ADD CONSTRAINT note_comments_pkey PRIMARY KEY (id);
1655
1656
1657 --
1658 -- Name: notes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1659 --
1660
1661 ALTER TABLE ONLY notes
1662     ADD CONSTRAINT notes_pkey PRIMARY KEY (id);
1663
1664
1665 --
1666 -- Name: oauth_nonces_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1667 --
1668
1669 ALTER TABLE ONLY oauth_nonces
1670     ADD CONSTRAINT oauth_nonces_pkey PRIMARY KEY (id);
1671
1672
1673 --
1674 -- Name: oauth_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1675 --
1676
1677 ALTER TABLE ONLY oauth_tokens
1678     ADD CONSTRAINT oauth_tokens_pkey PRIMARY KEY (id);
1679
1680
1681 --
1682 -- Name: redactions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1683 --
1684
1685 ALTER TABLE ONLY redactions
1686     ADD CONSTRAINT redactions_pkey PRIMARY KEY (id);
1687
1688
1689 --
1690 -- Name: relation_members_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1691 --
1692
1693 ALTER TABLE ONLY relation_members
1694     ADD CONSTRAINT relation_members_pkey PRIMARY KEY (relation_id, version, member_type, member_id, member_role, sequence_id);
1695
1696
1697 --
1698 -- Name: relation_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1699 --
1700
1701 ALTER TABLE ONLY relation_tags
1702     ADD CONSTRAINT relation_tags_pkey PRIMARY KEY (relation_id, version, k);
1703
1704
1705 --
1706 -- Name: relations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1707 --
1708
1709 ALTER TABLE ONLY relations
1710     ADD CONSTRAINT relations_pkey PRIMARY KEY (relation_id, version);
1711
1712
1713 --
1714 -- Name: reports_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
1715 --
1716
1717 ALTER TABLE ONLY reports
1718     ADD CONSTRAINT reports_pkey PRIMARY KEY (id);
1719
1720
1721 --
1722 -- Name: user_blocks_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1723 --
1724
1725 ALTER TABLE ONLY user_blocks
1726     ADD CONSTRAINT user_blocks_pkey PRIMARY KEY (id);
1727
1728
1729 --
1730 -- Name: user_preferences_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1731 --
1732
1733 ALTER TABLE ONLY user_preferences
1734     ADD CONSTRAINT user_preferences_pkey PRIMARY KEY (user_id, k);
1735
1736
1737 --
1738 -- Name: user_roles_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1739 --
1740
1741 ALTER TABLE ONLY user_roles
1742     ADD CONSTRAINT user_roles_pkey PRIMARY KEY (id);
1743
1744
1745 --
1746 -- Name: user_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1747 --
1748
1749 ALTER TABLE ONLY user_tokens
1750     ADD CONSTRAINT user_tokens_pkey PRIMARY KEY (id);
1751
1752
1753 --
1754 -- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1755 --
1756
1757 ALTER TABLE ONLY users
1758     ADD CONSTRAINT users_pkey PRIMARY KEY (id);
1759
1760
1761 --
1762 -- Name: way_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1763 --
1764
1765 ALTER TABLE ONLY way_nodes
1766     ADD CONSTRAINT way_nodes_pkey PRIMARY KEY (way_id, version, sequence_id);
1767
1768
1769 --
1770 -- Name: way_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1771 --
1772
1773 ALTER TABLE ONLY way_tags
1774     ADD CONSTRAINT way_tags_pkey PRIMARY KEY (way_id, version, k);
1775
1776
1777 --
1778 -- Name: ways_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1779 --
1780
1781 ALTER TABLE ONLY ways
1782     ADD CONSTRAINT ways_pkey PRIMARY KEY (way_id, version);
1783
1784
1785 --
1786 -- Name: acls_k_idx; Type: INDEX; Schema: public; Owner: -
1787 --
1788
1789 CREATE INDEX acls_k_idx ON acls USING btree (k);
1790
1791
1792 --
1793 -- Name: changeset_tags_id_idx; Type: INDEX; Schema: public; Owner: -
1794 --
1795
1796 CREATE INDEX changeset_tags_id_idx ON changeset_tags USING btree (changeset_id);
1797
1798
1799 --
1800 -- Name: changesets_bbox_idx; Type: INDEX; Schema: public; Owner: -
1801 --
1802
1803 CREATE INDEX changesets_bbox_idx ON changesets USING gist (min_lat, max_lat, min_lon, max_lon);
1804
1805
1806 --
1807 -- Name: changesets_closed_at_idx; Type: INDEX; Schema: public; Owner: -
1808 --
1809
1810 CREATE INDEX changesets_closed_at_idx ON changesets USING btree (closed_at);
1811
1812
1813 --
1814 -- Name: changesets_created_at_idx; Type: INDEX; Schema: public; Owner: -
1815 --
1816
1817 CREATE INDEX changesets_created_at_idx ON changesets USING btree (created_at);
1818
1819
1820 --
1821 -- Name: changesets_user_id_created_at_idx; Type: INDEX; Schema: public; Owner: -
1822 --
1823
1824 CREATE INDEX changesets_user_id_created_at_idx ON changesets USING btree (user_id, created_at);
1825
1826
1827 --
1828 -- Name: changesets_user_id_id_idx; Type: INDEX; Schema: public; Owner: -
1829 --
1830
1831 CREATE INDEX changesets_user_id_id_idx ON changesets USING btree (user_id, id);
1832
1833
1834 --
1835 -- Name: current_nodes_tile_idx; Type: INDEX; Schema: public; Owner: -
1836 --
1837
1838 CREATE INDEX current_nodes_tile_idx ON current_nodes USING btree (tile);
1839
1840
1841 --
1842 -- Name: current_nodes_timestamp_idx; Type: INDEX; Schema: public; Owner: -
1843 --
1844
1845 CREATE INDEX current_nodes_timestamp_idx ON current_nodes USING btree ("timestamp");
1846
1847
1848 --
1849 -- Name: current_relation_members_member_idx; Type: INDEX; Schema: public; Owner: -
1850 --
1851
1852 CREATE INDEX current_relation_members_member_idx ON current_relation_members USING btree (member_type, member_id);
1853
1854
1855 --
1856 -- Name: current_relations_timestamp_idx; Type: INDEX; Schema: public; Owner: -
1857 --
1858
1859 CREATE INDEX current_relations_timestamp_idx ON current_relations USING btree ("timestamp");
1860
1861
1862 --
1863 -- Name: current_way_nodes_node_idx; Type: INDEX; Schema: public; Owner: -
1864 --
1865
1866 CREATE INDEX current_way_nodes_node_idx ON current_way_nodes USING btree (node_id);
1867
1868
1869 --
1870 -- Name: current_ways_timestamp_idx; Type: INDEX; Schema: public; Owner: -
1871 --
1872
1873 CREATE INDEX current_ways_timestamp_idx ON current_ways USING btree ("timestamp");
1874
1875
1876 --
1877 -- Name: diary_comment_user_id_created_at_index; Type: INDEX; Schema: public; Owner: -
1878 --
1879
1880 CREATE INDEX diary_comment_user_id_created_at_index ON diary_comments USING btree (user_id, created_at);
1881
1882
1883 --
1884 -- Name: diary_comments_entry_id_idx; Type: INDEX; Schema: public; Owner: -
1885 --
1886
1887 CREATE UNIQUE INDEX diary_comments_entry_id_idx ON diary_comments USING btree (diary_entry_id, id);
1888
1889
1890 --
1891 -- Name: diary_entry_created_at_index; Type: INDEX; Schema: public; Owner: -
1892 --
1893
1894 CREATE INDEX diary_entry_created_at_index ON diary_entries USING btree (created_at);
1895
1896
1897 --
1898 -- Name: diary_entry_language_code_created_at_index; Type: INDEX; Schema: public; Owner: -
1899 --
1900
1901 CREATE INDEX diary_entry_language_code_created_at_index ON diary_entries USING btree (language_code, created_at);
1902
1903
1904 --
1905 -- Name: diary_entry_user_id_created_at_index; Type: INDEX; Schema: public; Owner: -
1906 --
1907
1908 CREATE INDEX diary_entry_user_id_created_at_index ON diary_entries USING btree (user_id, created_at);
1909
1910
1911 --
1912 -- Name: friends_user_id_idx; Type: INDEX; Schema: public; Owner: -
1913 --
1914
1915 CREATE INDEX friends_user_id_idx ON friends USING btree (user_id);
1916
1917
1918 --
1919 -- Name: gpx_file_tags_gpxid_idx; Type: INDEX; Schema: public; Owner: -
1920 --
1921
1922 CREATE INDEX gpx_file_tags_gpxid_idx ON gpx_file_tags USING btree (gpx_id);
1923
1924
1925 --
1926 -- Name: gpx_file_tags_tag_idx; Type: INDEX; Schema: public; Owner: -
1927 --
1928
1929 CREATE INDEX gpx_file_tags_tag_idx ON gpx_file_tags USING btree (tag);
1930
1931
1932 --
1933 -- Name: gpx_files_timestamp_idx; Type: INDEX; Schema: public; Owner: -
1934 --
1935
1936 CREATE INDEX gpx_files_timestamp_idx ON gpx_files USING btree ("timestamp");
1937
1938
1939 --
1940 -- Name: gpx_files_user_id_idx; Type: INDEX; Schema: public; Owner: -
1941 --
1942
1943 CREATE INDEX gpx_files_user_id_idx ON gpx_files USING btree (user_id);
1944
1945
1946 --
1947 -- Name: gpx_files_visible_visibility_idx; Type: INDEX; Schema: public; Owner: -
1948 --
1949
1950 CREATE INDEX gpx_files_visible_visibility_idx ON gpx_files USING btree (visible, visibility);
1951
1952
1953 --
1954 -- Name: index_changeset_comments_on_created_at; Type: INDEX; Schema: public; Owner: -
1955 --
1956
1957 CREATE INDEX index_changeset_comments_on_created_at ON changeset_comments USING btree (created_at);
1958
1959
1960 --
1961 -- Name: index_changesets_subscribers_on_changeset_id; Type: INDEX; Schema: public; Owner: -
1962 --
1963
1964 CREATE INDEX index_changesets_subscribers_on_changeset_id ON changesets_subscribers USING btree (changeset_id);
1965
1966
1967 --
1968 -- Name: index_changesets_subscribers_on_subscriber_id_and_changeset_id; Type: INDEX; Schema: public; Owner: -
1969 --
1970
1971 CREATE UNIQUE INDEX index_changesets_subscribers_on_subscriber_id_and_changeset_id ON changesets_subscribers USING btree (subscriber_id, changeset_id);
1972
1973
1974 --
1975 -- Name: index_client_applications_on_key; Type: INDEX; Schema: public; Owner: -
1976 --
1977
1978 CREATE UNIQUE INDEX index_client_applications_on_key ON client_applications USING btree (key);
1979
1980
1981 --
1982 -- Name: index_issue_comments_on_commenter_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
1983 --
1984
1985 CREATE INDEX index_issue_comments_on_commenter_user_id ON issue_comments USING btree (commenter_user_id);
1986
1987
1988 --
1989 -- Name: index_issue_comments_on_issue_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
1990 --
1991
1992 CREATE INDEX index_issue_comments_on_issue_id ON issue_comments USING btree (issue_id);
1993
1994
1995 --
1996 -- Name: index_issues_on_reportable_id_and_reportable_type; Type: INDEX; Schema: public; Owner: -; Tablespace: 
1997 --
1998
1999 CREATE INDEX index_issues_on_reportable_id_and_reportable_type ON issues USING btree (reportable_id, reportable_type);
2000
2001
2002 --
2003 -- Name: index_issues_on_reported_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
2004 --
2005
2006 CREATE INDEX index_issues_on_reported_user_id ON issues USING btree (reported_user_id);
2007
2008
2009 --
2010 -- Name: index_note_comments_on_body; Type: INDEX; Schema: public; Owner: -
2011 --
2012
2013 CREATE INDEX index_note_comments_on_body ON note_comments USING gin (to_tsvector('english'::regconfig, body));
2014
2015
2016 --
2017 -- Name: index_note_comments_on_created_at; Type: INDEX; Schema: public; Owner: -
2018 --
2019
2020 CREATE INDEX index_note_comments_on_created_at ON note_comments USING btree (created_at);
2021
2022
2023 --
2024 -- Name: index_oauth_nonces_on_nonce_and_timestamp; Type: INDEX; Schema: public; Owner: -
2025 --
2026
2027 CREATE UNIQUE INDEX index_oauth_nonces_on_nonce_and_timestamp ON oauth_nonces USING btree (nonce, "timestamp");
2028
2029
2030 --
2031 -- Name: index_oauth_tokens_on_token; Type: INDEX; Schema: public; Owner: -
2032 --
2033
2034 CREATE UNIQUE INDEX index_oauth_tokens_on_token ON oauth_tokens USING btree (token);
2035
2036
2037 --
2038 -- Name: index_reports_on_issue_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
2039 --
2040
2041 CREATE INDEX index_reports_on_issue_id ON reports USING btree (issue_id);
2042
2043
2044 --
2045 -- Name: index_reports_on_reporter_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
2046 --
2047
2048 CREATE INDEX index_reports_on_reporter_user_id ON reports USING btree (reporter_user_id);
2049
2050
2051 --
2052 -- Name: index_user_blocks_on_user_id; Type: INDEX; Schema: public; Owner: -
2053 --
2054
2055 CREATE INDEX index_user_blocks_on_user_id ON user_blocks USING btree (user_id);
2056
2057
2058 --
2059 -- Name: messages_from_user_id_idx; Type: INDEX; Schema: public; Owner: -
2060 --
2061
2062 CREATE INDEX messages_from_user_id_idx ON messages USING btree (from_user_id);
2063
2064
2065 --
2066 -- Name: messages_to_user_id_idx; Type: INDEX; Schema: public; Owner: -
2067 --
2068
2069 CREATE INDEX messages_to_user_id_idx ON messages USING btree (to_user_id);
2070
2071
2072 --
2073 -- Name: nodes_changeset_id_idx; Type: INDEX; Schema: public; Owner: -
2074 --
2075
2076 CREATE INDEX nodes_changeset_id_idx ON nodes USING btree (changeset_id);
2077
2078
2079 --
2080 -- Name: nodes_tile_idx; Type: INDEX; Schema: public; Owner: -
2081 --
2082
2083 CREATE INDEX nodes_tile_idx ON nodes USING btree (tile);
2084
2085
2086 --
2087 -- Name: nodes_timestamp_idx; Type: INDEX; Schema: public; Owner: -
2088 --
2089
2090 CREATE INDEX nodes_timestamp_idx ON nodes USING btree ("timestamp");
2091
2092
2093 --
2094 -- Name: note_comments_note_id_idx; Type: INDEX; Schema: public; Owner: -
2095 --
2096
2097 CREATE INDEX note_comments_note_id_idx ON note_comments USING btree (note_id);
2098
2099
2100 --
2101 -- Name: notes_created_at_idx; Type: INDEX; Schema: public; Owner: -
2102 --
2103
2104 CREATE INDEX notes_created_at_idx ON notes USING btree (created_at);
2105
2106
2107 --
2108 -- Name: notes_tile_status_idx; Type: INDEX; Schema: public; Owner: -
2109 --
2110
2111 CREATE INDEX notes_tile_status_idx ON notes USING btree (tile, status);
2112
2113
2114 --
2115 -- Name: notes_updated_at_idx; Type: INDEX; Schema: public; Owner: -
2116 --
2117
2118 CREATE INDEX notes_updated_at_idx ON notes USING btree (updated_at);
2119
2120
2121 --
2122 -- Name: points_gpxid_idx; Type: INDEX; Schema: public; Owner: -
2123 --
2124
2125 CREATE INDEX points_gpxid_idx ON gps_points USING btree (gpx_id);
2126
2127
2128 --
2129 -- Name: points_tile_idx; Type: INDEX; Schema: public; Owner: -
2130 --
2131
2132 CREATE INDEX points_tile_idx ON gps_points USING btree (tile);
2133
2134
2135 --
2136 -- Name: relation_members_member_idx; Type: INDEX; Schema: public; Owner: -
2137 --
2138
2139 CREATE INDEX relation_members_member_idx ON relation_members USING btree (member_type, member_id);
2140
2141
2142 --
2143 -- Name: relations_changeset_id_idx; Type: INDEX; Schema: public; Owner: -
2144 --
2145
2146 CREATE INDEX relations_changeset_id_idx ON relations USING btree (changeset_id);
2147
2148
2149 --
2150 -- Name: relations_timestamp_idx; Type: INDEX; Schema: public; Owner: -
2151 --
2152
2153 CREATE INDEX relations_timestamp_idx ON relations USING btree ("timestamp");
2154
2155
2156 --
2157 -- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -
2158 --
2159
2160 CREATE UNIQUE INDEX unique_schema_migrations ON schema_migrations USING btree (version);
2161
2162
2163 --
2164 -- Name: user_id_idx; Type: INDEX; Schema: public; Owner: -
2165 --
2166
2167 CREATE INDEX user_id_idx ON friends USING btree (friend_user_id);
2168
2169
2170 --
2171 -- Name: user_roles_id_role_unique; Type: INDEX; Schema: public; Owner: -
2172 --
2173
2174 CREATE UNIQUE INDEX user_roles_id_role_unique ON user_roles USING btree (user_id, role);
2175
2176
2177 --
2178 -- Name: user_tokens_token_idx; Type: INDEX; Schema: public; Owner: -
2179 --
2180
2181 CREATE UNIQUE INDEX user_tokens_token_idx ON user_tokens USING btree (token);
2182
2183
2184 --
2185 -- Name: user_tokens_user_id_idx; Type: INDEX; Schema: public; Owner: -
2186 --
2187
2188 CREATE INDEX user_tokens_user_id_idx ON user_tokens USING btree (user_id);
2189
2190
2191 --
2192 -- Name: users_auth_idx; Type: INDEX; Schema: public; Owner: -
2193 --
2194
2195 CREATE UNIQUE INDEX users_auth_idx ON users USING btree (auth_provider, auth_uid);
2196
2197
2198 --
2199 -- Name: users_display_name_idx; Type: INDEX; Schema: public; Owner: -
2200 --
2201
2202 CREATE UNIQUE INDEX users_display_name_idx ON users USING btree (display_name);
2203
2204
2205 --
2206 -- Name: users_display_name_lower_idx; Type: INDEX; Schema: public; Owner: -
2207 --
2208
2209 CREATE INDEX users_display_name_lower_idx ON users USING btree (lower((display_name)::text));
2210
2211
2212 --
2213 -- Name: users_email_idx; Type: INDEX; Schema: public; Owner: -
2214 --
2215
2216 CREATE UNIQUE INDEX users_email_idx ON users USING btree (email);
2217
2218
2219 --
2220 -- Name: users_email_lower_idx; Type: INDEX; Schema: public; Owner: -
2221 --
2222
2223 CREATE INDEX users_email_lower_idx ON users USING btree (lower((email)::text));
2224
2225
2226 --
2227 -- Name: way_nodes_node_idx; Type: INDEX; Schema: public; Owner: -
2228 --
2229
2230 CREATE INDEX way_nodes_node_idx ON way_nodes USING btree (node_id);
2231
2232
2233 --
2234 -- Name: ways_changeset_id_idx; Type: INDEX; Schema: public; Owner: -
2235 --
2236
2237 CREATE INDEX ways_changeset_id_idx ON ways USING btree (changeset_id);
2238
2239
2240 --
2241 -- Name: ways_timestamp_idx; Type: INDEX; Schema: public; Owner: -
2242 --
2243
2244 CREATE INDEX ways_timestamp_idx ON ways USING btree ("timestamp");
2245
2246
2247 --
2248 -- Name: changeset_comments_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2249 --
2250
2251 ALTER TABLE ONLY changeset_comments
2252     ADD CONSTRAINT changeset_comments_author_id_fkey FOREIGN KEY (author_id) REFERENCES users(id);
2253
2254
2255 --
2256 -- Name: changeset_comments_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2257 --
2258
2259 ALTER TABLE ONLY changeset_comments
2260     ADD CONSTRAINT changeset_comments_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2261
2262
2263 --
2264 -- Name: changeset_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2265 --
2266
2267 ALTER TABLE ONLY changeset_tags
2268     ADD CONSTRAINT changeset_tags_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2269
2270
2271 --
2272 -- Name: changesets_subscribers_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2273 --
2274
2275 ALTER TABLE ONLY changesets_subscribers
2276     ADD CONSTRAINT changesets_subscribers_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2277
2278
2279 --
2280 -- Name: changesets_subscribers_subscriber_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2281 --
2282
2283 ALTER TABLE ONLY changesets_subscribers
2284     ADD CONSTRAINT changesets_subscribers_subscriber_id_fkey FOREIGN KEY (subscriber_id) REFERENCES users(id);
2285
2286
2287 --
2288 -- Name: changesets_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2289 --
2290
2291 ALTER TABLE ONLY changesets
2292     ADD CONSTRAINT changesets_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2293
2294
2295 --
2296 -- Name: client_applications_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2297 --
2298
2299 ALTER TABLE ONLY client_applications
2300     ADD CONSTRAINT client_applications_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2301
2302
2303 --
2304 -- Name: current_node_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2305 --
2306
2307 ALTER TABLE ONLY current_node_tags
2308     ADD CONSTRAINT current_node_tags_id_fkey FOREIGN KEY (node_id) REFERENCES current_nodes(id);
2309
2310
2311 --
2312 -- Name: current_nodes_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2313 --
2314
2315 ALTER TABLE ONLY current_nodes
2316     ADD CONSTRAINT current_nodes_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2317
2318
2319 --
2320 -- Name: current_relation_members_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2321 --
2322
2323 ALTER TABLE ONLY current_relation_members
2324     ADD CONSTRAINT current_relation_members_id_fkey FOREIGN KEY (relation_id) REFERENCES current_relations(id);
2325
2326
2327 --
2328 -- Name: current_relation_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2329 --
2330
2331 ALTER TABLE ONLY current_relation_tags
2332     ADD CONSTRAINT current_relation_tags_id_fkey FOREIGN KEY (relation_id) REFERENCES current_relations(id);
2333
2334
2335 --
2336 -- Name: current_relations_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2337 --
2338
2339 ALTER TABLE ONLY current_relations
2340     ADD CONSTRAINT current_relations_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2341
2342
2343 --
2344 -- Name: current_way_nodes_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2345 --
2346
2347 ALTER TABLE ONLY current_way_nodes
2348     ADD CONSTRAINT current_way_nodes_id_fkey FOREIGN KEY (way_id) REFERENCES current_ways(id);
2349
2350
2351 --
2352 -- Name: current_way_nodes_node_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2353 --
2354
2355 ALTER TABLE ONLY current_way_nodes
2356     ADD CONSTRAINT current_way_nodes_node_id_fkey FOREIGN KEY (node_id) REFERENCES current_nodes(id);
2357
2358
2359 --
2360 -- Name: current_way_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2361 --
2362
2363 ALTER TABLE ONLY current_way_tags
2364     ADD CONSTRAINT current_way_tags_id_fkey FOREIGN KEY (way_id) REFERENCES current_ways(id);
2365
2366
2367 --
2368 -- Name: current_ways_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2369 --
2370
2371 ALTER TABLE ONLY current_ways
2372     ADD CONSTRAINT current_ways_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2373
2374
2375 --
2376 -- Name: diary_comments_diary_entry_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2377 --
2378
2379 ALTER TABLE ONLY diary_comments
2380     ADD CONSTRAINT diary_comments_diary_entry_id_fkey FOREIGN KEY (diary_entry_id) REFERENCES diary_entries(id);
2381
2382
2383 --
2384 -- Name: diary_comments_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2385 --
2386
2387 ALTER TABLE ONLY diary_comments
2388     ADD CONSTRAINT diary_comments_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2389
2390
2391 --
2392 -- Name: diary_entries_language_code_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2393 --
2394
2395 ALTER TABLE ONLY diary_entries
2396     ADD CONSTRAINT diary_entries_language_code_fkey FOREIGN KEY (language_code) REFERENCES languages(code);
2397
2398
2399 --
2400 -- Name: diary_entries_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2401 --
2402
2403 ALTER TABLE ONLY diary_entries
2404     ADD CONSTRAINT diary_entries_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2405
2406
2407 --
2408 -- Name: friends_friend_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2409 --
2410
2411 ALTER TABLE ONLY friends
2412     ADD CONSTRAINT friends_friend_user_id_fkey FOREIGN KEY (friend_user_id) REFERENCES users(id);
2413
2414
2415 --
2416 -- Name: friends_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2417 --
2418
2419 ALTER TABLE ONLY friends
2420     ADD CONSTRAINT friends_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2421
2422
2423 --
2424 -- Name: gps_points_gpx_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2425 --
2426
2427 ALTER TABLE ONLY gps_points
2428     ADD CONSTRAINT gps_points_gpx_id_fkey FOREIGN KEY (gpx_id) REFERENCES gpx_files(id);
2429
2430
2431 --
2432 -- Name: gpx_file_tags_gpx_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2433 --
2434
2435 ALTER TABLE ONLY gpx_file_tags
2436     ADD CONSTRAINT gpx_file_tags_gpx_id_fkey FOREIGN KEY (gpx_id) REFERENCES gpx_files(id);
2437
2438
2439 --
2440 -- Name: gpx_files_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2441 --
2442
2443 ALTER TABLE ONLY gpx_files
2444     ADD CONSTRAINT gpx_files_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2445
2446
2447 --
2448 -- Name: issue_comments_commenter_user_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2449 --
2450
2451 ALTER TABLE ONLY issue_comments
2452     ADD CONSTRAINT issue_comments_commenter_user_id FOREIGN KEY (commenter_user_id) REFERENCES users(id) ON DELETE CASCADE;
2453
2454
2455 --
2456 -- Name: issue_comments_issue_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2457 --
2458
2459 ALTER TABLE ONLY issue_comments
2460     ADD CONSTRAINT issue_comments_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
2461
2462
2463 --
2464 -- Name: issues_reported_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2465 --
2466
2467 ALTER TABLE ONLY issues
2468     ADD CONSTRAINT issues_reported_user_id_fkey FOREIGN KEY (reported_user_id) REFERENCES users(id) ON DELETE CASCADE;
2469
2470
2471 --
2472 -- Name: messages_from_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2473 --
2474
2475 ALTER TABLE ONLY messages
2476     ADD CONSTRAINT messages_from_user_id_fkey FOREIGN KEY (from_user_id) REFERENCES users(id);
2477
2478
2479 --
2480 -- Name: messages_to_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2481 --
2482
2483 ALTER TABLE ONLY messages
2484     ADD CONSTRAINT messages_to_user_id_fkey FOREIGN KEY (to_user_id) REFERENCES users(id);
2485
2486
2487 --
2488 -- Name: node_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2489 --
2490
2491 ALTER TABLE ONLY node_tags
2492     ADD CONSTRAINT node_tags_id_fkey FOREIGN KEY (node_id, version) REFERENCES nodes(node_id, version);
2493
2494
2495 --
2496 -- Name: nodes_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2497 --
2498
2499 ALTER TABLE ONLY nodes
2500     ADD CONSTRAINT nodes_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2501
2502
2503 --
2504 -- Name: nodes_redaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2505 --
2506
2507 ALTER TABLE ONLY nodes
2508     ADD CONSTRAINT nodes_redaction_id_fkey FOREIGN KEY (redaction_id) REFERENCES redactions(id);
2509
2510
2511 --
2512 -- Name: note_comments_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2513 --
2514
2515 ALTER TABLE ONLY note_comments
2516     ADD CONSTRAINT note_comments_author_id_fkey FOREIGN KEY (author_id) REFERENCES users(id);
2517
2518
2519 --
2520 -- Name: note_comments_note_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2521 --
2522
2523 ALTER TABLE ONLY note_comments
2524     ADD CONSTRAINT note_comments_note_id_fkey FOREIGN KEY (note_id) REFERENCES notes(id);
2525
2526
2527 --
2528 -- Name: oauth_tokens_client_application_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2529 --
2530
2531 ALTER TABLE ONLY oauth_tokens
2532     ADD CONSTRAINT oauth_tokens_client_application_id_fkey FOREIGN KEY (client_application_id) REFERENCES client_applications(id);
2533
2534
2535 --
2536 -- Name: oauth_tokens_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2537 --
2538
2539 ALTER TABLE ONLY oauth_tokens
2540     ADD CONSTRAINT oauth_tokens_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2541
2542
2543 --
2544 -- Name: redactions_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2545 --
2546
2547 ALTER TABLE ONLY redactions
2548     ADD CONSTRAINT redactions_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2549
2550
2551 --
2552 -- Name: relation_members_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2553 --
2554
2555 ALTER TABLE ONLY relation_members
2556     ADD CONSTRAINT relation_members_id_fkey FOREIGN KEY (relation_id, version) REFERENCES relations(relation_id, version);
2557
2558
2559 --
2560 -- Name: relation_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2561 --
2562
2563 ALTER TABLE ONLY relation_tags
2564     ADD CONSTRAINT relation_tags_id_fkey FOREIGN KEY (relation_id, version) REFERENCES relations(relation_id, version);
2565
2566
2567 --
2568 -- Name: relations_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2569 --
2570
2571 ALTER TABLE ONLY relations
2572     ADD CONSTRAINT relations_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2573
2574
2575 --
2576 -- Name: relations_redaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2577 --
2578
2579 ALTER TABLE ONLY relations
2580     ADD CONSTRAINT relations_redaction_id_fkey FOREIGN KEY (redaction_id) REFERENCES redactions(id);
2581
2582
2583 --
2584 -- Name: reports_issue_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2585 --
2586
2587 ALTER TABLE ONLY reports
2588     ADD CONSTRAINT reports_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
2589
2590
2591 --
2592 -- Name: reports_reporter_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2593 --
2594
2595 ALTER TABLE ONLY reports
2596     ADD CONSTRAINT reports_reporter_user_id_fkey FOREIGN KEY (reporter_user_id) REFERENCES users(id) ON DELETE CASCADE;
2597
2598
2599 --
2600 -- Name: user_blocks_moderator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2601 --
2602
2603 ALTER TABLE ONLY user_blocks
2604     ADD CONSTRAINT user_blocks_moderator_id_fkey FOREIGN KEY (creator_id) REFERENCES users(id);
2605
2606
2607 --
2608 -- Name: user_blocks_revoker_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2609 --
2610
2611 ALTER TABLE ONLY user_blocks
2612     ADD CONSTRAINT user_blocks_revoker_id_fkey FOREIGN KEY (revoker_id) REFERENCES users(id);
2613
2614
2615 --
2616 -- Name: user_blocks_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2617 --
2618
2619 ALTER TABLE ONLY user_blocks
2620     ADD CONSTRAINT user_blocks_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2621
2622
2623 --
2624 -- Name: user_preferences_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2625 --
2626
2627 ALTER TABLE ONLY user_preferences
2628     ADD CONSTRAINT user_preferences_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2629
2630
2631 --
2632 -- Name: user_roles_granter_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2633 --
2634
2635 ALTER TABLE ONLY user_roles
2636     ADD CONSTRAINT user_roles_granter_id_fkey FOREIGN KEY (granter_id) REFERENCES users(id);
2637
2638
2639 --
2640 -- Name: user_roles_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2641 --
2642
2643 ALTER TABLE ONLY user_roles
2644     ADD CONSTRAINT user_roles_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2645
2646
2647 --
2648 -- Name: user_tokens_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2649 --
2650
2651 ALTER TABLE ONLY user_tokens
2652     ADD CONSTRAINT user_tokens_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2653
2654
2655 --
2656 -- Name: way_nodes_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2657 --
2658
2659 ALTER TABLE ONLY way_nodes
2660     ADD CONSTRAINT way_nodes_id_fkey FOREIGN KEY (way_id, version) REFERENCES ways(way_id, version);
2661
2662
2663 --
2664 -- Name: way_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2665 --
2666
2667 ALTER TABLE ONLY way_tags
2668     ADD CONSTRAINT way_tags_id_fkey FOREIGN KEY (way_id, version) REFERENCES ways(way_id, version);
2669
2670
2671 --
2672 -- Name: ways_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2673 --
2674
2675 ALTER TABLE ONLY ways
2676     ADD CONSTRAINT ways_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2677
2678
2679 --
2680 -- Name: ways_redaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2681 --
2682
2683 ALTER TABLE ONLY ways
2684     ADD CONSTRAINT ways_redaction_id_fkey FOREIGN KEY (redaction_id) REFERENCES redactions(id);
2685
2686
2687 --
2688 -- PostgreSQL database dump complete
2689 --
2690
2691 SET search_path TO "$user", public;
2692
2693 INSERT INTO schema_migrations (version) VALUES ('1');
2694
2695 INSERT INTO schema_migrations (version) VALUES ('10');
2696
2697 INSERT INTO schema_migrations (version) VALUES ('11');
2698
2699 INSERT INTO schema_migrations (version) VALUES ('12');
2700
2701 INSERT INTO schema_migrations (version) VALUES ('13');
2702
2703 INSERT INTO schema_migrations (version) VALUES ('14');
2704
2705 INSERT INTO schema_migrations (version) VALUES ('15');
2706
2707 INSERT INTO schema_migrations (version) VALUES ('16');
2708
2709 INSERT INTO schema_migrations (version) VALUES ('17');
2710
2711 INSERT INTO schema_migrations (version) VALUES ('18');
2712
2713 INSERT INTO schema_migrations (version) VALUES ('19');
2714
2715 INSERT INTO schema_migrations (version) VALUES ('2');
2716
2717 INSERT INTO schema_migrations (version) VALUES ('20');
2718
2719 INSERT INTO schema_migrations (version) VALUES ('20100513171259');
2720
2721 INSERT INTO schema_migrations (version) VALUES ('20100516124737');
2722
2723 INSERT INTO schema_migrations (version) VALUES ('20100910084426');
2724
2725 INSERT INTO schema_migrations (version) VALUES ('20101114011429');
2726
2727 INSERT INTO schema_migrations (version) VALUES ('20110322001319');
2728
2729 INSERT INTO schema_migrations (version) VALUES ('20110508145337');
2730
2731 INSERT INTO schema_migrations (version) VALUES ('20110521142405');
2732
2733 INSERT INTO schema_migrations (version) VALUES ('20110925112722');
2734
2735 INSERT INTO schema_migrations (version) VALUES ('20111116184519');
2736
2737 INSERT INTO schema_migrations (version) VALUES ('20111212183945');
2738
2739 INSERT INTO schema_migrations (version) VALUES ('20120123184321');
2740
2741 INSERT INTO schema_migrations (version) VALUES ('20120208122334');
2742
2743 INSERT INTO schema_migrations (version) VALUES ('20120208194454');
2744
2745 INSERT INTO schema_migrations (version) VALUES ('20120214210114');
2746
2747 INSERT INTO schema_migrations (version) VALUES ('20120219161649');
2748
2749 INSERT INTO schema_migrations (version) VALUES ('20120318201948');
2750
2751 INSERT INTO schema_migrations (version) VALUES ('20120328090602');
2752
2753 INSERT INTO schema_migrations (version) VALUES ('20120404205604');
2754
2755 INSERT INTO schema_migrations (version) VALUES ('20120808231205');
2756
2757 INSERT INTO schema_migrations (version) VALUES ('20121005195010');
2758
2759 INSERT INTO schema_migrations (version) VALUES ('20121012044047');
2760
2761 INSERT INTO schema_migrations (version) VALUES ('20121119165817');
2762
2763 INSERT INTO schema_migrations (version) VALUES ('20121202155309');
2764
2765 INSERT INTO schema_migrations (version) VALUES ('20121203124841');
2766
2767 INSERT INTO schema_migrations (version) VALUES ('20130328184137');
2768
2769 INSERT INTO schema_migrations (version) VALUES ('20131029121300');
2770
2771 INSERT INTO schema_migrations (version) VALUES ('20131212124700');
2772
2773 INSERT INTO schema_migrations (version) VALUES ('20140115192822');
2774
2775 INSERT INTO schema_migrations (version) VALUES ('20140117185510');
2776
2777 INSERT INTO schema_migrations (version) VALUES ('20140210003018');
2778
2779 INSERT INTO schema_migrations (version) VALUES ('20140507110937');
2780
2781 INSERT INTO schema_migrations (version) VALUES ('20140519141742');
2782
2783 INSERT INTO schema_migrations (version) VALUES ('20150110152606');
2784
2785 INSERT INTO schema_migrations (version) VALUES ('20150111192335');
2786
2787 INSERT INTO schema_migrations (version) VALUES ('20150222101847');
2788
2789 INSERT INTO schema_migrations (version) VALUES ('20150516073616');
2790
2791 INSERT INTO schema_migrations (version) VALUES ('20150526130032');
2792
2793 INSERT INTO schema_migrations (version) VALUES ('21');
2794
2795 INSERT INTO schema_migrations (version) VALUES ('22');
2796
2797 INSERT INTO schema_migrations (version) VALUES ('23');
2798
2799 INSERT INTO schema_migrations (version) VALUES ('24');
2800
2801 INSERT INTO schema_migrations (version) VALUES ('25');
2802
2803 INSERT INTO schema_migrations (version) VALUES ('26');
2804
2805 INSERT INTO schema_migrations (version) VALUES ('27');
2806
2807 INSERT INTO schema_migrations (version) VALUES ('28');
2808
2809 INSERT INTO schema_migrations (version) VALUES ('29');
2810
2811 INSERT INTO schema_migrations (version) VALUES ('3');
2812
2813 INSERT INTO schema_migrations (version) VALUES ('30');
2814
2815 INSERT INTO schema_migrations (version) VALUES ('31');
2816
2817 INSERT INTO schema_migrations (version) VALUES ('32');
2818
2819 INSERT INTO schema_migrations (version) VALUES ('33');
2820
2821 INSERT INTO schema_migrations (version) VALUES ('34');
2822
2823 INSERT INTO schema_migrations (version) VALUES ('35');
2824
2825 INSERT INTO schema_migrations (version) VALUES ('36');
2826
2827 INSERT INTO schema_migrations (version) VALUES ('37');
2828
2829 INSERT INTO schema_migrations (version) VALUES ('38');
2830
2831 INSERT INTO schema_migrations (version) VALUES ('39');
2832
2833 INSERT INTO schema_migrations (version) VALUES ('4');
2834
2835 INSERT INTO schema_migrations (version) VALUES ('40');
2836
2837 INSERT INTO schema_migrations (version) VALUES ('41');
2838
2839 INSERT INTO schema_migrations (version) VALUES ('42');
2840
2841 INSERT INTO schema_migrations (version) VALUES ('43');
2842
2843 INSERT INTO schema_migrations (version) VALUES ('44');
2844
2845 INSERT INTO schema_migrations (version) VALUES ('45');
2846
2847 INSERT INTO schema_migrations (version) VALUES ('46');
2848
2849 INSERT INTO schema_migrations (version) VALUES ('47');
2850
2851 INSERT INTO schema_migrations (version) VALUES ('48');
2852
2853 INSERT INTO schema_migrations (version) VALUES ('49');
2854
2855 INSERT INTO schema_migrations (version) VALUES ('5');
2856
2857 INSERT INTO schema_migrations (version) VALUES ('50');
2858
2859 INSERT INTO schema_migrations (version) VALUES ('51');
2860
2861 INSERT INTO schema_migrations (version) VALUES ('52');
2862
2863 INSERT INTO schema_migrations (version) VALUES ('53');
2864
2865 INSERT INTO schema_migrations (version) VALUES ('54');
2866
2867 INSERT INTO schema_migrations (version) VALUES ('55');
2868
2869 INSERT INTO schema_migrations (version) VALUES ('56');
2870
2871 INSERT INTO schema_migrations (version) VALUES ('57');
2872
2873 INSERT INTO schema_migrations (version) VALUES ('6');
2874
2875 INSERT INTO schema_migrations (version) VALUES ('7');
2876
2877 INSERT INTO schema_migrations (version) VALUES ('8');
2878
2879 INSERT INTO schema_migrations (version) VALUES ('9');
2880