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