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