1 SET statement_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;
13 -- Name: btree_gist; Type: EXTENSION; Schema: -; Owner: -
16 CREATE EXTENSION IF NOT EXISTS btree_gist WITH SCHEMA public;
20 -- Name: EXTENSION btree_gist; Type: COMMENT; Schema: -; Owner: -
23 COMMENT ON EXTENSION btree_gist IS 'support for indexing common datatypes in GiST';
27 -- Name: format_enum; Type: TYPE; Schema: public; Owner: -
30 CREATE TYPE public.format_enum AS ENUM (
38 -- Name: gpx_visibility_enum; Type: TYPE; Schema: public; Owner: -
41 CREATE TYPE public.gpx_visibility_enum AS ENUM (
50 -- Name: issue_status_enum; Type: TYPE; Schema: public; Owner: -
53 CREATE TYPE public.issue_status_enum AS ENUM (
61 -- Name: note_event_enum; Type: TYPE; Schema: public; Owner: -
64 CREATE TYPE public.note_event_enum AS ENUM (
74 -- Name: note_status_enum; Type: TYPE; Schema: public; Owner: -
77 CREATE TYPE public.note_status_enum AS ENUM (
85 -- Name: nwr_enum; Type: TYPE; Schema: public; Owner: -
88 CREATE TYPE public.nwr_enum AS ENUM (
96 -- Name: user_role_enum; Type: TYPE; Schema: public; Owner: -
99 CREATE TYPE public.user_role_enum AS ENUM (
107 -- Name: user_status_enum; Type: TYPE; Schema: public; Owner: -
110 CREATE TYPE public.user_status_enum AS ENUM (
120 -- Name: api_rate_limit(bigint); Type: FUNCTION; Schema: public; Owner: -
123 CREATE FUNCTION public.api_rate_limit(user_id bigint) RETURNS integer
124 LANGUAGE plpgsql STABLE
127 min_changes_per_hour int4 := 100;
128 initial_changes_per_hour int4 := 1000;
129 max_changes_per_hour int4 := 100000;
130 days_to_max_changes int4 := 7;
131 importer_changes_per_hour int4 := 1000000;
132 moderator_changes_per_hour int4 := 1000000;
134 last_block timestamp without time zone;
135 first_change timestamp without time zone;
137 time_since_first_change double precision;
138 max_changes double precision;
141 SELECT ARRAY_AGG(user_roles.role) INTO STRICT roles FROM user_roles WHERE user_roles.user_id = api_rate_limit.user_id;
143 IF 'moderator' = ANY(roles) THEN
144 max_changes := moderator_changes_per_hour;
145 ELSIF 'importer' = ANY(roles) THEN
146 max_changes := importer_changes_per_hour;
148 SELECT user_blocks.created_at INTO last_block FROM user_blocks WHERE user_blocks.user_id = api_rate_limit.user_id ORDER BY user_blocks.created_at DESC LIMIT 1;
151 SELECT changesets.created_at INTO first_change FROM changesets WHERE changesets.user_id = api_rate_limit.user_id AND changesets.created_at > last_block ORDER BY changesets.created_at LIMIT 1;
153 SELECT changesets.created_at INTO first_change FROM changesets WHERE changesets.user_id = api_rate_limit.user_id ORDER BY changesets.created_at LIMIT 1;
157 first_change := CURRENT_TIMESTAMP AT TIME ZONE 'UTC';
160 SELECT COUNT(*) INTO STRICT active_reports
161 FROM issues INNER JOIN reports ON reports.issue_id = issues.id
162 WHERE issues.reported_user_id = api_rate_limit.user_id AND issues.status = 'open' AND reports.updated_at >= COALESCE(issues.resolved_at, '1970-01-01');
164 time_since_first_change := EXTRACT(EPOCH FROM CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - first_change);
166 max_changes := max_changes_per_hour * POWER(time_since_first_change, 2) / POWER(days_to_max_changes * 24 * 60 * 60, 2);
167 max_changes := GREATEST(initial_changes_per_hour, LEAST(max_changes_per_hour, FLOOR(max_changes)));
168 max_changes := max_changes / POWER(2, active_reports);
169 max_changes := GREATEST(min_changes_per_hour, LEAST(max_changes_per_hour, max_changes));
172 SELECT COALESCE(SUM(changesets.num_changes), 0) INTO STRICT recent_changes FROM changesets WHERE changesets.user_id = api_rate_limit.user_id AND changesets.created_at >= CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - '1 hour'::interval;
174 RETURN max_changes - recent_changes;
180 -- Name: api_size_limit(bigint); Type: FUNCTION; Schema: public; Owner: -
183 CREATE FUNCTION public.api_size_limit(user_id bigint) RETURNS bigint
184 LANGUAGE plpgsql STABLE
187 min_size_limit int8 := 10000000;
188 initial_size_limit int8 := 30000000;
189 max_size_limit int8 := 5400000000;
190 days_to_max_size_limit int4 := 28;
191 importer_size_limit int8 := 5400000000;
192 moderator_size_limit int8 := 5400000000;
194 last_block timestamp without time zone;
195 first_change timestamp without time zone;
197 time_since_first_change double precision;
200 SELECT ARRAY_AGG(user_roles.role) INTO STRICT roles FROM user_roles WHERE user_roles.user_id = api_size_limit.user_id;
202 IF 'moderator' = ANY(roles) THEN
203 size_limit := moderator_size_limit;
204 ELSIF 'importer' = ANY(roles) THEN
205 size_limit := importer_size_limit;
207 SELECT user_blocks.created_at INTO last_block FROM user_blocks WHERE user_blocks.user_id = api_size_limit.user_id ORDER BY user_blocks.created_at DESC LIMIT 1;
210 SELECT changesets.created_at INTO first_change FROM changesets WHERE changesets.user_id = api_size_limit.user_id AND changesets.created_at > last_block ORDER BY changesets.created_at LIMIT 1;
212 SELECT changesets.created_at INTO first_change FROM changesets WHERE changesets.user_id = api_size_limit.user_id ORDER BY changesets.created_at LIMIT 1;
216 first_change := CURRENT_TIMESTAMP AT TIME ZONE 'UTC';
219 SELECT COUNT(*) INTO STRICT active_reports
220 FROM issues INNER JOIN reports ON reports.issue_id = issues.id
221 WHERE issues.reported_user_id = api_size_limit.user_id AND issues.status = 'open' AND reports.updated_at >= COALESCE(issues.resolved_at, '1970-01-01');
223 time_since_first_change := EXTRACT(EPOCH FROM CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - first_change);
225 size_limit := max_size_limit * POWER(time_since_first_change, 2) / POWER(days_to_max_size_limit * 24 * 60 * 60, 2);
226 size_limit := GREATEST(initial_size_limit, LEAST(max_size_limit, FLOOR(size_limit)));
227 size_limit := size_limit / POWER(2, active_reports);
228 size_limit := GREATEST(min_size_limit, LEAST(max_size_limit, size_limit));
236 SET default_tablespace = '';
238 SET default_table_access_method = heap;
241 -- Name: acls; Type: TABLE; Schema: public; Owner: -
244 CREATE TABLE public.acls (
247 k character varying NOT NULL,
249 domain character varying,
255 -- Name: acls_id_seq; Type: SEQUENCE; Schema: public; Owner: -
258 CREATE SEQUENCE public.acls_id_seq
267 -- Name: acls_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
270 ALTER SEQUENCE public.acls_id_seq OWNED BY public.acls.id;
274 -- Name: active_storage_attachments; Type: TABLE; Schema: public; Owner: -
277 CREATE TABLE public.active_storage_attachments (
279 name character varying NOT NULL,
280 record_type character varying NOT NULL,
281 record_id bigint NOT NULL,
282 blob_id bigint NOT NULL,
283 created_at timestamp without time zone NOT NULL
288 -- Name: active_storage_attachments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
291 CREATE SEQUENCE public.active_storage_attachments_id_seq
300 -- Name: active_storage_attachments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
303 ALTER SEQUENCE public.active_storage_attachments_id_seq OWNED BY public.active_storage_attachments.id;
307 -- Name: active_storage_blobs; Type: TABLE; Schema: public; Owner: -
310 CREATE TABLE public.active_storage_blobs (
312 key character varying NOT NULL,
313 filename character varying NOT NULL,
314 content_type character varying,
316 byte_size bigint NOT NULL,
317 checksum character varying,
318 created_at timestamp without time zone NOT NULL,
319 service_name character varying NOT NULL
324 -- Name: active_storage_blobs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
327 CREATE SEQUENCE public.active_storage_blobs_id_seq
336 -- Name: active_storage_blobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
339 ALTER SEQUENCE public.active_storage_blobs_id_seq OWNED BY public.active_storage_blobs.id;
343 -- Name: active_storage_variant_records; Type: TABLE; Schema: public; Owner: -
346 CREATE TABLE public.active_storage_variant_records (
348 blob_id bigint NOT NULL,
349 variation_digest character varying NOT NULL
354 -- Name: active_storage_variant_records_id_seq; Type: SEQUENCE; Schema: public; Owner: -
357 CREATE SEQUENCE public.active_storage_variant_records_id_seq
366 -- Name: active_storage_variant_records_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
369 ALTER SEQUENCE public.active_storage_variant_records_id_seq OWNED BY public.active_storage_variant_records.id;
373 -- Name: ar_internal_metadata; Type: TABLE; Schema: public; Owner: -
376 CREATE TABLE public.ar_internal_metadata (
377 key character varying NOT NULL,
378 value character varying,
379 created_at timestamp(6) without time zone NOT NULL,
380 updated_at timestamp(6) without time zone NOT NULL
385 -- Name: changeset_comments; Type: TABLE; Schema: public; Owner: -
388 CREATE TABLE public.changeset_comments (
390 changeset_id bigint NOT NULL,
391 author_id bigint NOT NULL,
393 created_at timestamp without time zone NOT NULL,
394 visible boolean NOT NULL
399 -- Name: changeset_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
402 CREATE SEQUENCE public.changeset_comments_id_seq
412 -- Name: changeset_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
415 ALTER SEQUENCE public.changeset_comments_id_seq OWNED BY public.changeset_comments.id;
419 -- Name: changeset_tags; Type: TABLE; Schema: public; Owner: -
422 CREATE TABLE public.changeset_tags (
423 changeset_id bigint NOT NULL,
424 k character varying DEFAULT ''::character varying NOT NULL,
425 v character varying DEFAULT ''::character varying NOT NULL
430 -- Name: changesets; Type: TABLE; Schema: public; Owner: -
433 CREATE TABLE public.changesets (
435 user_id bigint NOT NULL,
436 created_at timestamp without time zone NOT NULL,
441 closed_at timestamp without time zone NOT NULL,
442 num_changes integer DEFAULT 0 NOT NULL
447 -- Name: changesets_id_seq; Type: SEQUENCE; Schema: public; Owner: -
450 CREATE SEQUENCE public.changesets_id_seq
459 -- Name: changesets_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
462 ALTER SEQUENCE public.changesets_id_seq OWNED BY public.changesets.id;
466 -- Name: changesets_subscribers; Type: TABLE; Schema: public; Owner: -
469 CREATE TABLE public.changesets_subscribers (
470 subscriber_id bigint NOT NULL,
471 changeset_id bigint NOT NULL
476 -- Name: current_node_tags; Type: TABLE; Schema: public; Owner: -
479 CREATE TABLE public.current_node_tags (
480 node_id bigint NOT NULL,
481 k character varying DEFAULT ''::character varying NOT NULL,
482 v character varying DEFAULT ''::character varying NOT NULL
487 -- Name: current_nodes; Type: TABLE; Schema: public; Owner: -
490 CREATE TABLE public.current_nodes (
492 latitude integer NOT NULL,
493 longitude integer NOT NULL,
494 changeset_id bigint NOT NULL,
495 visible boolean NOT NULL,
496 "timestamp" timestamp without time zone NOT NULL,
497 tile bigint NOT NULL,
498 version bigint NOT NULL
503 -- Name: current_nodes_id_seq; Type: SEQUENCE; Schema: public; Owner: -
506 CREATE SEQUENCE public.current_nodes_id_seq
515 -- Name: current_nodes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
518 ALTER SEQUENCE public.current_nodes_id_seq OWNED BY public.current_nodes.id;
522 -- Name: current_relation_members; Type: TABLE; Schema: public; Owner: -
525 CREATE TABLE public.current_relation_members (
526 relation_id bigint NOT NULL,
527 member_type public.nwr_enum NOT NULL,
528 member_id bigint NOT NULL,
529 member_role character varying NOT NULL,
530 sequence_id integer DEFAULT 0 NOT NULL
535 -- Name: current_relation_tags; Type: TABLE; Schema: public; Owner: -
538 CREATE TABLE public.current_relation_tags (
539 relation_id bigint NOT NULL,
540 k character varying DEFAULT ''::character varying NOT NULL,
541 v character varying DEFAULT ''::character varying NOT NULL
546 -- Name: current_relations; Type: TABLE; Schema: public; Owner: -
549 CREATE TABLE public.current_relations (
551 changeset_id bigint NOT NULL,
552 "timestamp" timestamp without time zone NOT NULL,
553 visible boolean NOT NULL,
554 version bigint NOT NULL
559 -- Name: current_relations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
562 CREATE SEQUENCE public.current_relations_id_seq
571 -- Name: current_relations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
574 ALTER SEQUENCE public.current_relations_id_seq OWNED BY public.current_relations.id;
578 -- Name: current_way_nodes; Type: TABLE; Schema: public; Owner: -
581 CREATE TABLE public.current_way_nodes (
582 way_id bigint NOT NULL,
583 node_id bigint NOT NULL,
584 sequence_id bigint NOT NULL
589 -- Name: current_way_tags; Type: TABLE; Schema: public; Owner: -
592 CREATE TABLE public.current_way_tags (
593 way_id bigint NOT NULL,
594 k character varying DEFAULT ''::character varying NOT NULL,
595 v character varying DEFAULT ''::character varying NOT NULL
600 -- Name: current_ways; Type: TABLE; Schema: public; Owner: -
603 CREATE TABLE public.current_ways (
605 changeset_id bigint NOT NULL,
606 "timestamp" timestamp without time zone NOT NULL,
607 visible boolean NOT NULL,
608 version bigint NOT NULL
613 -- Name: current_ways_id_seq; Type: SEQUENCE; Schema: public; Owner: -
616 CREATE SEQUENCE public.current_ways_id_seq
625 -- Name: current_ways_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
628 ALTER SEQUENCE public.current_ways_id_seq OWNED BY public.current_ways.id;
632 -- Name: delayed_jobs; Type: TABLE; Schema: public; Owner: -
635 CREATE TABLE public.delayed_jobs (
637 priority integer DEFAULT 0 NOT NULL,
638 attempts integer DEFAULT 0 NOT NULL,
639 handler text NOT NULL,
641 run_at timestamp without time zone,
642 locked_at timestamp without time zone,
643 failed_at timestamp without time zone,
644 locked_by character varying,
645 queue character varying,
646 created_at timestamp without time zone,
647 updated_at timestamp without time zone
652 -- Name: delayed_jobs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
655 CREATE SEQUENCE public.delayed_jobs_id_seq
664 -- Name: delayed_jobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
667 ALTER SEQUENCE public.delayed_jobs_id_seq OWNED BY public.delayed_jobs.id;
671 -- Name: diary_comments; Type: TABLE; Schema: public; Owner: -
674 CREATE TABLE public.diary_comments (
676 diary_entry_id bigint NOT NULL,
677 user_id bigint NOT NULL,
679 created_at timestamp without time zone NOT NULL,
680 updated_at timestamp without time zone NOT NULL,
681 visible boolean DEFAULT true NOT NULL,
682 body_format public.format_enum DEFAULT 'markdown'::public.format_enum NOT NULL
687 -- Name: diary_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
690 CREATE SEQUENCE public.diary_comments_id_seq
699 -- Name: diary_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
702 ALTER SEQUENCE public.diary_comments_id_seq OWNED BY public.diary_comments.id;
706 -- Name: diary_entries; Type: TABLE; Schema: public; Owner: -
709 CREATE TABLE public.diary_entries (
711 user_id bigint NOT NULL,
712 title character varying NOT NULL,
714 created_at timestamp without time zone NOT NULL,
715 updated_at timestamp without time zone NOT NULL,
716 latitude double precision,
717 longitude double precision,
718 language_code character varying DEFAULT 'en'::character varying NOT NULL,
719 visible boolean DEFAULT true NOT NULL,
720 body_format public.format_enum DEFAULT 'markdown'::public.format_enum NOT NULL
725 -- Name: diary_entries_id_seq; Type: SEQUENCE; Schema: public; Owner: -
728 CREATE SEQUENCE public.diary_entries_id_seq
737 -- Name: diary_entries_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
740 ALTER SEQUENCE public.diary_entries_id_seq OWNED BY public.diary_entries.id;
744 -- Name: diary_entry_subscriptions; Type: TABLE; Schema: public; Owner: -
747 CREATE TABLE public.diary_entry_subscriptions (
748 user_id bigint NOT NULL,
749 diary_entry_id bigint NOT NULL
754 -- Name: friends; Type: TABLE; Schema: public; Owner: -
757 CREATE TABLE public.friends (
759 user_id bigint NOT NULL,
760 friend_user_id bigint NOT NULL,
761 created_at timestamp without time zone
766 -- Name: friends_id_seq; Type: SEQUENCE; Schema: public; Owner: -
769 CREATE SEQUENCE public.friends_id_seq
778 -- Name: friends_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
781 ALTER SEQUENCE public.friends_id_seq OWNED BY public.friends.id;
785 -- Name: gps_points; Type: TABLE; Schema: public; Owner: -
788 CREATE TABLE public.gps_points (
789 altitude double precision,
790 trackid integer NOT NULL,
791 latitude integer NOT NULL,
792 longitude integer NOT NULL,
793 gpx_id bigint NOT NULL,
794 "timestamp" timestamp without time zone,
800 -- Name: gpx_file_tags; Type: TABLE; Schema: public; Owner: -
803 CREATE TABLE public.gpx_file_tags (
804 gpx_id bigint NOT NULL,
805 tag character varying NOT NULL,
811 -- Name: gpx_file_tags_id_seq; Type: SEQUENCE; Schema: public; Owner: -
814 CREATE SEQUENCE public.gpx_file_tags_id_seq
823 -- Name: gpx_file_tags_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
826 ALTER SEQUENCE public.gpx_file_tags_id_seq OWNED BY public.gpx_file_tags.id;
830 -- Name: gpx_files; Type: TABLE; Schema: public; Owner: -
833 CREATE TABLE public.gpx_files (
835 user_id bigint NOT NULL,
836 visible boolean DEFAULT true NOT NULL,
837 name character varying DEFAULT ''::character varying NOT NULL,
839 latitude double precision,
840 longitude double precision,
841 "timestamp" timestamp without time zone NOT NULL,
842 description character varying DEFAULT ''::character varying NOT NULL,
843 inserted boolean NOT NULL,
844 visibility public.gpx_visibility_enum DEFAULT 'public'::public.gpx_visibility_enum NOT NULL
849 -- Name: gpx_files_id_seq; Type: SEQUENCE; Schema: public; Owner: -
852 CREATE SEQUENCE public.gpx_files_id_seq
861 -- Name: gpx_files_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
864 ALTER SEQUENCE public.gpx_files_id_seq OWNED BY public.gpx_files.id;
868 -- Name: issue_comments; Type: TABLE; Schema: public; Owner: -
871 CREATE TABLE public.issue_comments (
873 issue_id integer NOT NULL,
874 user_id integer NOT NULL,
876 created_at timestamp without time zone NOT NULL,
877 updated_at timestamp without time zone NOT NULL
882 -- Name: issue_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
885 CREATE SEQUENCE public.issue_comments_id_seq
895 -- Name: issue_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
898 ALTER SEQUENCE public.issue_comments_id_seq OWNED BY public.issue_comments.id;
902 -- Name: issues; Type: TABLE; Schema: public; Owner: -
905 CREATE TABLE public.issues (
907 reportable_type character varying NOT NULL,
908 reportable_id integer NOT NULL,
909 reported_user_id integer,
910 status public.issue_status_enum DEFAULT 'open'::public.issue_status_enum NOT NULL,
911 assigned_role public.user_role_enum NOT NULL,
912 resolved_at timestamp without time zone,
915 reports_count integer DEFAULT 0,
916 created_at timestamp without time zone NOT NULL,
917 updated_at timestamp without time zone NOT NULL
922 -- Name: issues_id_seq; Type: SEQUENCE; Schema: public; Owner: -
925 CREATE SEQUENCE public.issues_id_seq
935 -- Name: issues_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
938 ALTER SEQUENCE public.issues_id_seq OWNED BY public.issues.id;
942 -- Name: languages; Type: TABLE; Schema: public; Owner: -
945 CREATE TABLE public.languages (
946 code character varying NOT NULL,
947 english_name character varying NOT NULL,
948 native_name character varying
953 -- Name: messages; Type: TABLE; Schema: public; Owner: -
956 CREATE TABLE public.messages (
958 from_user_id bigint NOT NULL,
959 title character varying NOT NULL,
961 sent_on timestamp without time zone NOT NULL,
962 message_read boolean DEFAULT false NOT NULL,
963 to_user_id bigint NOT NULL,
964 to_user_visible boolean DEFAULT true NOT NULL,
965 from_user_visible boolean DEFAULT true NOT NULL,
966 body_format public.format_enum DEFAULT 'markdown'::public.format_enum NOT NULL,
967 muted boolean DEFAULT false NOT NULL
972 -- Name: messages_id_seq; Type: SEQUENCE; Schema: public; Owner: -
975 CREATE SEQUENCE public.messages_id_seq
984 -- Name: messages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
987 ALTER SEQUENCE public.messages_id_seq OWNED BY public.messages.id;
991 -- Name: node_tags; Type: TABLE; Schema: public; Owner: -
994 CREATE TABLE public.node_tags (
995 node_id bigint NOT NULL,
996 version bigint NOT NULL,
997 k character varying DEFAULT ''::character varying NOT NULL,
998 v character varying DEFAULT ''::character varying NOT NULL
1003 -- Name: nodes; Type: TABLE; Schema: public; Owner: -
1006 CREATE TABLE public.nodes (
1007 node_id bigint NOT NULL,
1008 latitude integer NOT NULL,
1009 longitude integer NOT NULL,
1010 changeset_id bigint NOT NULL,
1011 visible boolean NOT NULL,
1012 "timestamp" timestamp without time zone NOT NULL,
1013 tile bigint NOT NULL,
1014 version bigint NOT NULL,
1015 redaction_id integer
1020 -- Name: note_comments; Type: TABLE; Schema: public; Owner: -
1023 CREATE TABLE public.note_comments (
1025 note_id bigint NOT NULL,
1026 visible boolean NOT NULL,
1027 created_at timestamp without time zone NOT NULL,
1031 event public.note_event_enum
1036 -- Name: note_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1039 CREATE SEQUENCE public.note_comments_id_seq
1048 -- Name: note_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1051 ALTER SEQUENCE public.note_comments_id_seq OWNED BY public.note_comments.id;
1055 -- Name: note_subscriptions; Type: TABLE; Schema: public; Owner: -
1058 CREATE TABLE public.note_subscriptions (
1059 user_id bigint NOT NULL,
1060 note_id bigint NOT NULL
1065 -- Name: notes; Type: TABLE; Schema: public; Owner: -
1068 CREATE TABLE public.notes (
1070 latitude integer NOT NULL,
1071 longitude integer NOT NULL,
1072 tile bigint NOT NULL,
1073 updated_at timestamp without time zone NOT NULL,
1074 created_at timestamp without time zone NOT NULL,
1075 status public.note_status_enum NOT NULL,
1076 closed_at timestamp without time zone,
1077 description text DEFAULT ''::text NOT NULL,
1084 -- Name: notes_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1087 CREATE SEQUENCE public.notes_id_seq
1096 -- Name: notes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1099 ALTER SEQUENCE public.notes_id_seq OWNED BY public.notes.id;
1103 -- Name: oauth_access_grants; Type: TABLE; Schema: public; Owner: -
1106 CREATE TABLE public.oauth_access_grants (
1108 resource_owner_id bigint NOT NULL,
1109 application_id bigint NOT NULL,
1110 token character varying NOT NULL,
1111 expires_in integer NOT NULL,
1112 redirect_uri text NOT NULL,
1113 created_at timestamp without time zone NOT NULL,
1114 revoked_at timestamp without time zone,
1115 scopes character varying DEFAULT ''::character varying NOT NULL,
1116 code_challenge character varying,
1117 code_challenge_method character varying
1122 -- Name: oauth_access_grants_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1125 CREATE SEQUENCE public.oauth_access_grants_id_seq
1134 -- Name: oauth_access_grants_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1137 ALTER SEQUENCE public.oauth_access_grants_id_seq OWNED BY public.oauth_access_grants.id;
1141 -- Name: oauth_access_tokens; Type: TABLE; Schema: public; Owner: -
1144 CREATE TABLE public.oauth_access_tokens (
1146 resource_owner_id bigint,
1147 application_id bigint NOT NULL,
1148 token character varying NOT NULL,
1149 refresh_token character varying,
1151 revoked_at timestamp without time zone,
1152 created_at timestamp without time zone NOT NULL,
1153 scopes character varying,
1154 previous_refresh_token character varying DEFAULT ''::character varying NOT NULL
1159 -- Name: oauth_access_tokens_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1162 CREATE SEQUENCE public.oauth_access_tokens_id_seq
1171 -- Name: oauth_access_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1174 ALTER SEQUENCE public.oauth_access_tokens_id_seq OWNED BY public.oauth_access_tokens.id;
1178 -- Name: oauth_applications; Type: TABLE; Schema: public; Owner: -
1181 CREATE TABLE public.oauth_applications (
1183 owner_type character varying NOT NULL,
1184 owner_id bigint NOT NULL,
1185 name character varying NOT NULL,
1186 uid character varying NOT NULL,
1187 secret character varying NOT NULL,
1188 redirect_uri text NOT NULL,
1189 scopes character varying DEFAULT ''::character varying NOT NULL,
1190 confidential boolean DEFAULT true NOT NULL,
1191 created_at timestamp(6) without time zone NOT NULL,
1192 updated_at timestamp(6) without time zone NOT NULL
1197 -- Name: oauth_applications_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1200 CREATE SEQUENCE public.oauth_applications_id_seq
1209 -- Name: oauth_applications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1212 ALTER SEQUENCE public.oauth_applications_id_seq OWNED BY public.oauth_applications.id;
1216 -- Name: oauth_openid_requests; Type: TABLE; Schema: public; Owner: -
1219 CREATE TABLE public.oauth_openid_requests (
1221 access_grant_id bigint NOT NULL,
1222 nonce character varying NOT NULL
1227 -- Name: oauth_openid_requests_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1230 CREATE SEQUENCE public.oauth_openid_requests_id_seq
1239 -- Name: oauth_openid_requests_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1242 ALTER SEQUENCE public.oauth_openid_requests_id_seq OWNED BY public.oauth_openid_requests.id;
1246 -- Name: redactions; Type: TABLE; Schema: public; Owner: -
1249 CREATE TABLE public.redactions (
1250 id integer NOT NULL,
1251 title character varying NOT NULL,
1252 description text NOT NULL,
1253 created_at timestamp without time zone,
1254 updated_at timestamp without time zone,
1255 user_id bigint NOT NULL,
1256 description_format public.format_enum DEFAULT 'markdown'::public.format_enum NOT NULL
1261 -- Name: redactions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1264 CREATE SEQUENCE public.redactions_id_seq
1274 -- Name: redactions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1277 ALTER SEQUENCE public.redactions_id_seq OWNED BY public.redactions.id;
1281 -- Name: relation_members; Type: TABLE; Schema: public; Owner: -
1284 CREATE TABLE public.relation_members (
1285 relation_id bigint NOT NULL,
1286 member_type public.nwr_enum NOT NULL,
1287 member_id bigint NOT NULL,
1288 member_role character varying NOT NULL,
1289 version bigint DEFAULT 0 NOT NULL,
1290 sequence_id integer DEFAULT 0 NOT NULL
1295 -- Name: relation_tags; Type: TABLE; Schema: public; Owner: -
1298 CREATE TABLE public.relation_tags (
1299 relation_id bigint NOT NULL,
1300 k character varying DEFAULT ''::character varying NOT NULL,
1301 v character varying DEFAULT ''::character varying NOT NULL,
1302 version bigint NOT NULL
1307 -- Name: relations; Type: TABLE; Schema: public; Owner: -
1310 CREATE TABLE public.relations (
1311 relation_id bigint NOT NULL,
1312 changeset_id bigint NOT NULL,
1313 "timestamp" timestamp without time zone NOT NULL,
1314 version bigint NOT NULL,
1315 visible boolean DEFAULT true NOT NULL,
1316 redaction_id integer
1321 -- Name: reports; Type: TABLE; Schema: public; Owner: -
1324 CREATE TABLE public.reports (
1325 id integer NOT NULL,
1326 issue_id integer NOT NULL,
1327 user_id integer NOT NULL,
1328 details text NOT NULL,
1329 category character varying NOT NULL,
1330 created_at timestamp without time zone NOT NULL,
1331 updated_at timestamp without time zone NOT NULL
1336 -- Name: reports_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1339 CREATE SEQUENCE public.reports_id_seq
1349 -- Name: reports_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1352 ALTER SEQUENCE public.reports_id_seq OWNED BY public.reports.id;
1356 -- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -
1359 CREATE TABLE public.schema_migrations (
1360 version character varying NOT NULL
1365 -- Name: user_blocks; Type: TABLE; Schema: public; Owner: -
1368 CREATE TABLE public.user_blocks (
1369 id integer NOT NULL,
1370 user_id bigint NOT NULL,
1371 creator_id bigint NOT NULL,
1372 reason text NOT NULL,
1373 ends_at timestamp without time zone NOT NULL,
1374 needs_view boolean DEFAULT false NOT NULL,
1376 created_at timestamp without time zone,
1377 updated_at timestamp without time zone,
1378 reason_format public.format_enum DEFAULT 'markdown'::public.format_enum NOT NULL,
1379 deactivates_at timestamp without time zone
1384 -- Name: user_blocks_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1387 CREATE SEQUENCE public.user_blocks_id_seq
1397 -- Name: user_blocks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1400 ALTER SEQUENCE public.user_blocks_id_seq OWNED BY public.user_blocks.id;
1404 -- Name: user_mutes; Type: TABLE; Schema: public; Owner: -
1407 CREATE TABLE public.user_mutes (
1409 owner_id bigint NOT NULL,
1410 subject_id bigint NOT NULL,
1411 created_at timestamp(6) without time zone NOT NULL,
1412 updated_at timestamp(6) without time zone NOT NULL
1417 -- Name: user_mutes_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1420 CREATE SEQUENCE public.user_mutes_id_seq
1429 -- Name: user_mutes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1432 ALTER SEQUENCE public.user_mutes_id_seq OWNED BY public.user_mutes.id;
1436 -- Name: user_preferences; Type: TABLE; Schema: public; Owner: -
1439 CREATE TABLE public.user_preferences (
1440 user_id bigint NOT NULL,
1441 k character varying NOT NULL,
1442 v character varying NOT NULL
1447 -- Name: user_roles; Type: TABLE; Schema: public; Owner: -
1450 CREATE TABLE public.user_roles (
1451 id integer NOT NULL,
1452 user_id bigint NOT NULL,
1453 role public.user_role_enum NOT NULL,
1454 created_at timestamp without time zone,
1455 updated_at timestamp without time zone,
1456 granter_id bigint NOT NULL
1461 -- Name: user_roles_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1464 CREATE SEQUENCE public.user_roles_id_seq
1474 -- Name: user_roles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1477 ALTER SEQUENCE public.user_roles_id_seq OWNED BY public.user_roles.id;
1481 -- Name: users; Type: TABLE; Schema: public; Owner: -
1484 CREATE TABLE public.users (
1485 email character varying NOT NULL,
1487 pass_crypt character varying NOT NULL,
1488 creation_time timestamp without time zone NOT NULL,
1489 display_name character varying DEFAULT ''::character varying NOT NULL,
1490 data_public boolean DEFAULT false NOT NULL,
1491 description text DEFAULT ''::text NOT NULL,
1492 home_lat double precision,
1493 home_lon double precision,
1494 home_zoom smallint DEFAULT 3,
1495 pass_salt character varying,
1496 email_valid boolean DEFAULT false NOT NULL,
1497 new_email character varying,
1498 languages character varying,
1499 status public.user_status_enum DEFAULT 'pending'::public.user_status_enum NOT NULL,
1500 terms_agreed timestamp without time zone,
1501 consider_pd boolean DEFAULT false NOT NULL,
1502 auth_uid character varying,
1503 preferred_editor character varying,
1504 terms_seen boolean DEFAULT false NOT NULL,
1505 description_format public.format_enum DEFAULT 'markdown'::public.format_enum NOT NULL,
1506 changesets_count integer DEFAULT 0 NOT NULL,
1507 traces_count integer DEFAULT 0 NOT NULL,
1508 diary_entries_count integer DEFAULT 0 NOT NULL,
1509 image_use_gravatar boolean DEFAULT false NOT NULL,
1510 auth_provider character varying,
1512 tou_agreed timestamp without time zone,
1513 diary_comments_count integer DEFAULT 0,
1514 note_comments_count integer DEFAULT 0,
1515 creation_address inet
1520 -- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1523 CREATE SEQUENCE public.users_id_seq
1532 -- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1535 ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;
1539 -- Name: way_nodes; Type: TABLE; Schema: public; Owner: -
1542 CREATE TABLE public.way_nodes (
1543 way_id bigint NOT NULL,
1544 node_id bigint NOT NULL,
1545 version bigint NOT NULL,
1546 sequence_id bigint NOT NULL
1551 -- Name: way_tags; Type: TABLE; Schema: public; Owner: -
1554 CREATE TABLE public.way_tags (
1555 way_id bigint NOT NULL,
1556 k character varying NOT NULL,
1557 v character varying NOT NULL,
1558 version bigint NOT NULL
1563 -- Name: ways; Type: TABLE; Schema: public; Owner: -
1566 CREATE TABLE public.ways (
1567 way_id bigint NOT NULL,
1568 changeset_id bigint NOT NULL,
1569 "timestamp" timestamp without time zone NOT NULL,
1570 version bigint NOT NULL,
1571 visible boolean DEFAULT true NOT NULL,
1572 redaction_id integer
1577 -- Name: acls id; Type: DEFAULT; Schema: public; Owner: -
1580 ALTER TABLE ONLY public.acls ALTER COLUMN id SET DEFAULT nextval('public.acls_id_seq'::regclass);
1584 -- Name: active_storage_attachments id; Type: DEFAULT; Schema: public; Owner: -
1587 ALTER TABLE ONLY public.active_storage_attachments ALTER COLUMN id SET DEFAULT nextval('public.active_storage_attachments_id_seq'::regclass);
1591 -- Name: active_storage_blobs id; Type: DEFAULT; Schema: public; Owner: -
1594 ALTER TABLE ONLY public.active_storage_blobs ALTER COLUMN id SET DEFAULT nextval('public.active_storage_blobs_id_seq'::regclass);
1598 -- Name: active_storage_variant_records id; Type: DEFAULT; Schema: public; Owner: -
1601 ALTER TABLE ONLY public.active_storage_variant_records ALTER COLUMN id SET DEFAULT nextval('public.active_storage_variant_records_id_seq'::regclass);
1605 -- Name: changeset_comments id; Type: DEFAULT; Schema: public; Owner: -
1608 ALTER TABLE ONLY public.changeset_comments ALTER COLUMN id SET DEFAULT nextval('public.changeset_comments_id_seq'::regclass);
1612 -- Name: changesets id; Type: DEFAULT; Schema: public; Owner: -
1615 ALTER TABLE ONLY public.changesets ALTER COLUMN id SET DEFAULT nextval('public.changesets_id_seq'::regclass);
1619 -- Name: current_nodes id; Type: DEFAULT; Schema: public; Owner: -
1622 ALTER TABLE ONLY public.current_nodes ALTER COLUMN id SET DEFAULT nextval('public.current_nodes_id_seq'::regclass);
1626 -- Name: current_relations id; Type: DEFAULT; Schema: public; Owner: -
1629 ALTER TABLE ONLY public.current_relations ALTER COLUMN id SET DEFAULT nextval('public.current_relations_id_seq'::regclass);
1633 -- Name: current_ways id; Type: DEFAULT; Schema: public; Owner: -
1636 ALTER TABLE ONLY public.current_ways ALTER COLUMN id SET DEFAULT nextval('public.current_ways_id_seq'::regclass);
1640 -- Name: delayed_jobs id; Type: DEFAULT; Schema: public; Owner: -
1643 ALTER TABLE ONLY public.delayed_jobs ALTER COLUMN id SET DEFAULT nextval('public.delayed_jobs_id_seq'::regclass);
1647 -- Name: diary_comments id; Type: DEFAULT; Schema: public; Owner: -
1650 ALTER TABLE ONLY public.diary_comments ALTER COLUMN id SET DEFAULT nextval('public.diary_comments_id_seq'::regclass);
1654 -- Name: diary_entries id; Type: DEFAULT; Schema: public; Owner: -
1657 ALTER TABLE ONLY public.diary_entries ALTER COLUMN id SET DEFAULT nextval('public.diary_entries_id_seq'::regclass);
1661 -- Name: friends id; Type: DEFAULT; Schema: public; Owner: -
1664 ALTER TABLE ONLY public.friends ALTER COLUMN id SET DEFAULT nextval('public.friends_id_seq'::regclass);
1668 -- Name: gpx_file_tags id; Type: DEFAULT; Schema: public; Owner: -
1671 ALTER TABLE ONLY public.gpx_file_tags ALTER COLUMN id SET DEFAULT nextval('public.gpx_file_tags_id_seq'::regclass);
1675 -- Name: gpx_files id; Type: DEFAULT; Schema: public; Owner: -
1678 ALTER TABLE ONLY public.gpx_files ALTER COLUMN id SET DEFAULT nextval('public.gpx_files_id_seq'::regclass);
1682 -- Name: issue_comments id; Type: DEFAULT; Schema: public; Owner: -
1685 ALTER TABLE ONLY public.issue_comments ALTER COLUMN id SET DEFAULT nextval('public.issue_comments_id_seq'::regclass);
1689 -- Name: issues id; Type: DEFAULT; Schema: public; Owner: -
1692 ALTER TABLE ONLY public.issues ALTER COLUMN id SET DEFAULT nextval('public.issues_id_seq'::regclass);
1696 -- Name: messages id; Type: DEFAULT; Schema: public; Owner: -
1699 ALTER TABLE ONLY public.messages ALTER COLUMN id SET DEFAULT nextval('public.messages_id_seq'::regclass);
1703 -- Name: note_comments id; Type: DEFAULT; Schema: public; Owner: -
1706 ALTER TABLE ONLY public.note_comments ALTER COLUMN id SET DEFAULT nextval('public.note_comments_id_seq'::regclass);
1710 -- Name: notes id; Type: DEFAULT; Schema: public; Owner: -
1713 ALTER TABLE ONLY public.notes ALTER COLUMN id SET DEFAULT nextval('public.notes_id_seq'::regclass);
1717 -- Name: oauth_access_grants id; Type: DEFAULT; Schema: public; Owner: -
1720 ALTER TABLE ONLY public.oauth_access_grants ALTER COLUMN id SET DEFAULT nextval('public.oauth_access_grants_id_seq'::regclass);
1724 -- Name: oauth_access_tokens id; Type: DEFAULT; Schema: public; Owner: -
1727 ALTER TABLE ONLY public.oauth_access_tokens ALTER COLUMN id SET DEFAULT nextval('public.oauth_access_tokens_id_seq'::regclass);
1731 -- Name: oauth_applications id; Type: DEFAULT; Schema: public; Owner: -
1734 ALTER TABLE ONLY public.oauth_applications ALTER COLUMN id SET DEFAULT nextval('public.oauth_applications_id_seq'::regclass);
1738 -- Name: oauth_openid_requests id; Type: DEFAULT; Schema: public; Owner: -
1741 ALTER TABLE ONLY public.oauth_openid_requests ALTER COLUMN id SET DEFAULT nextval('public.oauth_openid_requests_id_seq'::regclass);
1745 -- Name: redactions id; Type: DEFAULT; Schema: public; Owner: -
1748 ALTER TABLE ONLY public.redactions ALTER COLUMN id SET DEFAULT nextval('public.redactions_id_seq'::regclass);
1752 -- Name: reports id; Type: DEFAULT; Schema: public; Owner: -
1755 ALTER TABLE ONLY public.reports ALTER COLUMN id SET DEFAULT nextval('public.reports_id_seq'::regclass);
1759 -- Name: user_blocks id; Type: DEFAULT; Schema: public; Owner: -
1762 ALTER TABLE ONLY public.user_blocks ALTER COLUMN id SET DEFAULT nextval('public.user_blocks_id_seq'::regclass);
1766 -- Name: user_mutes id; Type: DEFAULT; Schema: public; Owner: -
1769 ALTER TABLE ONLY public.user_mutes ALTER COLUMN id SET DEFAULT nextval('public.user_mutes_id_seq'::regclass);
1773 -- Name: user_roles id; Type: DEFAULT; Schema: public; Owner: -
1776 ALTER TABLE ONLY public.user_roles ALTER COLUMN id SET DEFAULT nextval('public.user_roles_id_seq'::regclass);
1780 -- Name: users id; Type: DEFAULT; Schema: public; Owner: -
1783 ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass);
1787 -- Name: acls acls_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1790 ALTER TABLE ONLY public.acls
1791 ADD CONSTRAINT acls_pkey PRIMARY KEY (id);
1795 -- Name: active_storage_attachments active_storage_attachments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1798 ALTER TABLE ONLY public.active_storage_attachments
1799 ADD CONSTRAINT active_storage_attachments_pkey PRIMARY KEY (id);
1803 -- Name: active_storage_blobs active_storage_blobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1806 ALTER TABLE ONLY public.active_storage_blobs
1807 ADD CONSTRAINT active_storage_blobs_pkey PRIMARY KEY (id);
1811 -- Name: active_storage_variant_records active_storage_variant_records_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1814 ALTER TABLE ONLY public.active_storage_variant_records
1815 ADD CONSTRAINT active_storage_variant_records_pkey PRIMARY KEY (id);
1819 -- Name: ar_internal_metadata ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1822 ALTER TABLE ONLY public.ar_internal_metadata
1823 ADD CONSTRAINT ar_internal_metadata_pkey PRIMARY KEY (key);
1827 -- Name: changeset_comments changeset_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1830 ALTER TABLE ONLY public.changeset_comments
1831 ADD CONSTRAINT changeset_comments_pkey PRIMARY KEY (id);
1835 -- Name: changeset_tags changeset_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1838 ALTER TABLE ONLY public.changeset_tags
1839 ADD CONSTRAINT changeset_tags_pkey PRIMARY KEY (changeset_id, k);
1843 -- Name: changesets changesets_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1846 ALTER TABLE ONLY public.changesets
1847 ADD CONSTRAINT changesets_pkey PRIMARY KEY (id);
1851 -- Name: current_node_tags current_node_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1854 ALTER TABLE ONLY public.current_node_tags
1855 ADD CONSTRAINT current_node_tags_pkey PRIMARY KEY (node_id, k);
1859 -- Name: current_nodes current_nodes_pkey1; Type: CONSTRAINT; Schema: public; Owner: -
1862 ALTER TABLE ONLY public.current_nodes
1863 ADD CONSTRAINT current_nodes_pkey1 PRIMARY KEY (id);
1867 -- Name: current_relation_members current_relation_members_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1870 ALTER TABLE ONLY public.current_relation_members
1871 ADD CONSTRAINT current_relation_members_pkey PRIMARY KEY (relation_id, sequence_id);
1875 -- Name: current_relation_tags current_relation_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1878 ALTER TABLE ONLY public.current_relation_tags
1879 ADD CONSTRAINT current_relation_tags_pkey PRIMARY KEY (relation_id, k);
1883 -- Name: current_relations current_relations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1886 ALTER TABLE ONLY public.current_relations
1887 ADD CONSTRAINT current_relations_pkey PRIMARY KEY (id);
1891 -- Name: current_way_nodes current_way_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1894 ALTER TABLE ONLY public.current_way_nodes
1895 ADD CONSTRAINT current_way_nodes_pkey PRIMARY KEY (way_id, sequence_id);
1899 -- Name: current_way_tags current_way_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1902 ALTER TABLE ONLY public.current_way_tags
1903 ADD CONSTRAINT current_way_tags_pkey PRIMARY KEY (way_id, k);
1907 -- Name: current_ways current_ways_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1910 ALTER TABLE ONLY public.current_ways
1911 ADD CONSTRAINT current_ways_pkey PRIMARY KEY (id);
1915 -- Name: delayed_jobs delayed_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1918 ALTER TABLE ONLY public.delayed_jobs
1919 ADD CONSTRAINT delayed_jobs_pkey PRIMARY KEY (id);
1923 -- Name: diary_comments diary_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1926 ALTER TABLE ONLY public.diary_comments
1927 ADD CONSTRAINT diary_comments_pkey PRIMARY KEY (id);
1931 -- Name: diary_entries diary_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1934 ALTER TABLE ONLY public.diary_entries
1935 ADD CONSTRAINT diary_entries_pkey PRIMARY KEY (id);
1939 -- Name: diary_entry_subscriptions diary_entry_subscriptions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1942 ALTER TABLE ONLY public.diary_entry_subscriptions
1943 ADD CONSTRAINT diary_entry_subscriptions_pkey PRIMARY KEY (user_id, diary_entry_id);
1947 -- Name: friends friends_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1950 ALTER TABLE ONLY public.friends
1951 ADD CONSTRAINT friends_pkey PRIMARY KEY (id);
1955 -- Name: gpx_file_tags gpx_file_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1958 ALTER TABLE ONLY public.gpx_file_tags
1959 ADD CONSTRAINT gpx_file_tags_pkey PRIMARY KEY (id);
1963 -- Name: gpx_files gpx_files_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1966 ALTER TABLE ONLY public.gpx_files
1967 ADD CONSTRAINT gpx_files_pkey PRIMARY KEY (id);
1971 -- Name: issue_comments issue_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1974 ALTER TABLE ONLY public.issue_comments
1975 ADD CONSTRAINT issue_comments_pkey PRIMARY KEY (id);
1979 -- Name: issues issues_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1982 ALTER TABLE ONLY public.issues
1983 ADD CONSTRAINT issues_pkey PRIMARY KEY (id);
1987 -- Name: languages languages_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1990 ALTER TABLE ONLY public.languages
1991 ADD CONSTRAINT languages_pkey PRIMARY KEY (code);
1995 -- Name: messages messages_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1998 ALTER TABLE ONLY public.messages
1999 ADD CONSTRAINT messages_pkey PRIMARY KEY (id);
2003 -- Name: node_tags node_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2006 ALTER TABLE ONLY public.node_tags
2007 ADD CONSTRAINT node_tags_pkey PRIMARY KEY (node_id, version, k);
2011 -- Name: nodes nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2014 ALTER TABLE ONLY public.nodes
2015 ADD CONSTRAINT nodes_pkey PRIMARY KEY (node_id, version);
2019 -- Name: note_comments note_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2022 ALTER TABLE ONLY public.note_comments
2023 ADD CONSTRAINT note_comments_pkey PRIMARY KEY (id);
2027 -- Name: note_subscriptions note_subscriptions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2030 ALTER TABLE ONLY public.note_subscriptions
2031 ADD CONSTRAINT note_subscriptions_pkey PRIMARY KEY (user_id, note_id);
2035 -- Name: notes notes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2038 ALTER TABLE ONLY public.notes
2039 ADD CONSTRAINT notes_pkey PRIMARY KEY (id);
2043 -- Name: oauth_access_grants oauth_access_grants_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2046 ALTER TABLE ONLY public.oauth_access_grants
2047 ADD CONSTRAINT oauth_access_grants_pkey PRIMARY KEY (id);
2051 -- Name: oauth_access_tokens oauth_access_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2054 ALTER TABLE ONLY public.oauth_access_tokens
2055 ADD CONSTRAINT oauth_access_tokens_pkey PRIMARY KEY (id);
2059 -- Name: oauth_applications oauth_applications_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2062 ALTER TABLE ONLY public.oauth_applications
2063 ADD CONSTRAINT oauth_applications_pkey PRIMARY KEY (id);
2067 -- Name: oauth_openid_requests oauth_openid_requests_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2070 ALTER TABLE ONLY public.oauth_openid_requests
2071 ADD CONSTRAINT oauth_openid_requests_pkey PRIMARY KEY (id);
2075 -- Name: redactions redactions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2078 ALTER TABLE ONLY public.redactions
2079 ADD CONSTRAINT redactions_pkey PRIMARY KEY (id);
2083 -- Name: relation_members relation_members_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2086 ALTER TABLE ONLY public.relation_members
2087 ADD CONSTRAINT relation_members_pkey PRIMARY KEY (relation_id, version, sequence_id);
2091 -- Name: relation_tags relation_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2094 ALTER TABLE ONLY public.relation_tags
2095 ADD CONSTRAINT relation_tags_pkey PRIMARY KEY (relation_id, version, k);
2099 -- Name: relations relations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2102 ALTER TABLE ONLY public.relations
2103 ADD CONSTRAINT relations_pkey PRIMARY KEY (relation_id, version);
2107 -- Name: reports reports_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2110 ALTER TABLE ONLY public.reports
2111 ADD CONSTRAINT reports_pkey PRIMARY KEY (id);
2115 -- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2118 ALTER TABLE ONLY public.schema_migrations
2119 ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version);
2123 -- Name: user_blocks user_blocks_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2126 ALTER TABLE ONLY public.user_blocks
2127 ADD CONSTRAINT user_blocks_pkey PRIMARY KEY (id);
2131 -- Name: user_mutes user_mutes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2134 ALTER TABLE ONLY public.user_mutes
2135 ADD CONSTRAINT user_mutes_pkey PRIMARY KEY (id);
2139 -- Name: user_preferences user_preferences_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2142 ALTER TABLE ONLY public.user_preferences
2143 ADD CONSTRAINT user_preferences_pkey PRIMARY KEY (user_id, k);
2147 -- Name: user_roles user_roles_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2150 ALTER TABLE ONLY public.user_roles
2151 ADD CONSTRAINT user_roles_pkey PRIMARY KEY (id);
2155 -- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2158 ALTER TABLE ONLY public.users
2159 ADD CONSTRAINT users_pkey PRIMARY KEY (id);
2163 -- Name: way_nodes way_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2166 ALTER TABLE ONLY public.way_nodes
2167 ADD CONSTRAINT way_nodes_pkey PRIMARY KEY (way_id, version, sequence_id);
2171 -- Name: way_tags way_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2174 ALTER TABLE ONLY public.way_tags
2175 ADD CONSTRAINT way_tags_pkey PRIMARY KEY (way_id, version, k);
2179 -- Name: ways ways_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2182 ALTER TABLE ONLY public.ways
2183 ADD CONSTRAINT ways_pkey PRIMARY KEY (way_id, version);
2187 -- Name: acls_k_idx; Type: INDEX; Schema: public; Owner: -
2190 CREATE INDEX acls_k_idx ON public.acls USING btree (k);
2194 -- Name: changesets_bbox_idx; Type: INDEX; Schema: public; Owner: -
2197 CREATE INDEX changesets_bbox_idx ON public.changesets USING gist (min_lat, max_lat, min_lon, max_lon);
2201 -- Name: changesets_closed_at_idx; Type: INDEX; Schema: public; Owner: -
2204 CREATE INDEX changesets_closed_at_idx ON public.changesets USING btree (closed_at);
2208 -- Name: changesets_created_at_idx; Type: INDEX; Schema: public; Owner: -
2211 CREATE INDEX changesets_created_at_idx ON public.changesets USING btree (created_at);
2215 -- Name: changesets_user_id_created_at_idx; Type: INDEX; Schema: public; Owner: -
2218 CREATE INDEX changesets_user_id_created_at_idx ON public.changesets USING btree (user_id, created_at);
2222 -- Name: changesets_user_id_id_idx; Type: INDEX; Schema: public; Owner: -
2225 CREATE INDEX changesets_user_id_id_idx ON public.changesets USING btree (user_id, id);
2229 -- Name: current_nodes_tile_idx; Type: INDEX; Schema: public; Owner: -
2232 CREATE INDEX current_nodes_tile_idx ON public.current_nodes USING btree (tile);
2236 -- Name: current_nodes_timestamp_idx; Type: INDEX; Schema: public; Owner: -
2239 CREATE INDEX current_nodes_timestamp_idx ON public.current_nodes USING btree ("timestamp");
2243 -- Name: current_relation_members_member_idx; Type: INDEX; Schema: public; Owner: -
2246 CREATE INDEX current_relation_members_member_idx ON public.current_relation_members USING btree (member_type, member_id);
2250 -- Name: current_relations_timestamp_idx; Type: INDEX; Schema: public; Owner: -
2253 CREATE INDEX current_relations_timestamp_idx ON public.current_relations USING btree ("timestamp");
2257 -- Name: current_way_nodes_node_idx; Type: INDEX; Schema: public; Owner: -
2260 CREATE INDEX current_way_nodes_node_idx ON public.current_way_nodes USING btree (node_id);
2264 -- Name: current_ways_timestamp_idx; Type: INDEX; Schema: public; Owner: -
2267 CREATE INDEX current_ways_timestamp_idx ON public.current_ways USING btree ("timestamp");
2271 -- Name: delayed_jobs_priority; Type: INDEX; Schema: public; Owner: -
2274 CREATE INDEX delayed_jobs_priority ON public.delayed_jobs USING btree (priority, run_at);
2278 -- Name: diary_comment_user_id_created_at_index; Type: INDEX; Schema: public; Owner: -
2281 CREATE INDEX diary_comment_user_id_created_at_index ON public.diary_comments USING btree (user_id, created_at);
2285 -- Name: diary_comments_entry_id_idx; Type: INDEX; Schema: public; Owner: -
2288 CREATE UNIQUE INDEX diary_comments_entry_id_idx ON public.diary_comments USING btree (diary_entry_id, id);
2292 -- Name: diary_entry_created_at_index; Type: INDEX; Schema: public; Owner: -
2295 CREATE INDEX diary_entry_created_at_index ON public.diary_entries USING btree (created_at);
2299 -- Name: diary_entry_language_code_created_at_index; Type: INDEX; Schema: public; Owner: -
2302 CREATE INDEX diary_entry_language_code_created_at_index ON public.diary_entries USING btree (language_code, created_at);
2306 -- Name: diary_entry_user_id_created_at_index; Type: INDEX; Schema: public; Owner: -
2309 CREATE INDEX diary_entry_user_id_created_at_index ON public.diary_entries USING btree (user_id, created_at);
2313 -- Name: gpx_file_tags_gpxid_idx; Type: INDEX; Schema: public; Owner: -
2316 CREATE INDEX gpx_file_tags_gpxid_idx ON public.gpx_file_tags USING btree (gpx_id);
2320 -- Name: gpx_file_tags_tag_idx; Type: INDEX; Schema: public; Owner: -
2323 CREATE INDEX gpx_file_tags_tag_idx ON public.gpx_file_tags USING btree (tag);
2327 -- Name: gpx_files_timestamp_idx; Type: INDEX; Schema: public; Owner: -
2330 CREATE INDEX gpx_files_timestamp_idx ON public.gpx_files USING btree ("timestamp");
2334 -- Name: gpx_files_user_id_idx; Type: INDEX; Schema: public; Owner: -
2337 CREATE INDEX gpx_files_user_id_idx ON public.gpx_files USING btree (user_id);
2341 -- Name: gpx_files_visible_visibility_idx; Type: INDEX; Schema: public; Owner: -
2344 CREATE INDEX gpx_files_visible_visibility_idx ON public.gpx_files USING btree (visible, visibility);
2348 -- Name: index_acls_on_address; Type: INDEX; Schema: public; Owner: -
2351 CREATE INDEX index_acls_on_address ON public.acls USING gist (address inet_ops);
2355 -- Name: index_acls_on_domain; Type: INDEX; Schema: public; Owner: -
2358 CREATE INDEX index_acls_on_domain ON public.acls USING btree (domain);
2362 -- Name: index_acls_on_mx; Type: INDEX; Schema: public; Owner: -
2365 CREATE INDEX index_acls_on_mx ON public.acls USING btree (mx);
2369 -- Name: index_active_storage_attachments_on_blob_id; Type: INDEX; Schema: public; Owner: -
2372 CREATE INDEX index_active_storage_attachments_on_blob_id ON public.active_storage_attachments USING btree (blob_id);
2376 -- Name: index_active_storage_attachments_uniqueness; Type: INDEX; Schema: public; Owner: -
2379 CREATE UNIQUE INDEX index_active_storage_attachments_uniqueness ON public.active_storage_attachments USING btree (record_type, record_id, name, blob_id);
2383 -- Name: index_active_storage_blobs_on_key; Type: INDEX; Schema: public; Owner: -
2386 CREATE UNIQUE INDEX index_active_storage_blobs_on_key ON public.active_storage_blobs USING btree (key);
2390 -- Name: index_active_storage_variant_records_uniqueness; Type: INDEX; Schema: public; Owner: -
2393 CREATE UNIQUE INDEX index_active_storage_variant_records_uniqueness ON public.active_storage_variant_records USING btree (blob_id, variation_digest);
2397 -- Name: index_changeset_comments_on_author_id_and_created_at; Type: INDEX; Schema: public; Owner: -
2400 CREATE INDEX index_changeset_comments_on_author_id_and_created_at ON public.changeset_comments USING btree (author_id, created_at);
2404 -- Name: index_changeset_comments_on_changeset_id_and_created_at; Type: INDEX; Schema: public; Owner: -
2407 CREATE INDEX index_changeset_comments_on_changeset_id_and_created_at ON public.changeset_comments USING btree (changeset_id, created_at);
2411 -- Name: index_changeset_comments_on_created_at; Type: INDEX; Schema: public; Owner: -
2414 CREATE INDEX index_changeset_comments_on_created_at ON public.changeset_comments USING btree (created_at);
2418 -- Name: index_changesets_on_user_id_and_closed_at; Type: INDEX; Schema: public; Owner: -
2421 CREATE INDEX index_changesets_on_user_id_and_closed_at ON public.changesets USING btree (user_id, closed_at);
2425 -- Name: index_changesets_subscribers_on_changeset_id; Type: INDEX; Schema: public; Owner: -
2428 CREATE INDEX index_changesets_subscribers_on_changeset_id ON public.changesets_subscribers USING btree (changeset_id);
2432 -- Name: index_changesets_subscribers_on_subscriber_id_and_changeset_id; Type: INDEX; Schema: public; Owner: -
2435 CREATE UNIQUE INDEX index_changesets_subscribers_on_subscriber_id_and_changeset_id ON public.changesets_subscribers USING btree (subscriber_id, changeset_id);
2439 -- Name: index_diary_entry_subscriptions_on_diary_entry_id; Type: INDEX; Schema: public; Owner: -
2442 CREATE INDEX index_diary_entry_subscriptions_on_diary_entry_id ON public.diary_entry_subscriptions USING btree (diary_entry_id);
2446 -- Name: index_friends_on_user_id_and_created_at; Type: INDEX; Schema: public; Owner: -
2449 CREATE INDEX index_friends_on_user_id_and_created_at ON public.friends USING btree (user_id, created_at);
2453 -- Name: index_issue_comments_on_issue_id; Type: INDEX; Schema: public; Owner: -
2456 CREATE INDEX index_issue_comments_on_issue_id ON public.issue_comments USING btree (issue_id);
2460 -- Name: index_issue_comments_on_user_id; Type: INDEX; Schema: public; Owner: -
2463 CREATE INDEX index_issue_comments_on_user_id ON public.issue_comments USING btree (user_id);
2467 -- Name: index_issues_on_assigned_role; Type: INDEX; Schema: public; Owner: -
2470 CREATE INDEX index_issues_on_assigned_role ON public.issues USING btree (assigned_role);
2474 -- Name: index_issues_on_reportable_type_and_reportable_id; Type: INDEX; Schema: public; Owner: -
2477 CREATE INDEX index_issues_on_reportable_type_and_reportable_id ON public.issues USING btree (reportable_type, reportable_id);
2481 -- Name: index_issues_on_reported_user_id; Type: INDEX; Schema: public; Owner: -
2484 CREATE INDEX index_issues_on_reported_user_id ON public.issues USING btree (reported_user_id);
2488 -- Name: index_issues_on_status; Type: INDEX; Schema: public; Owner: -
2491 CREATE INDEX index_issues_on_status ON public.issues USING btree (status);
2495 -- Name: index_issues_on_updated_by; Type: INDEX; Schema: public; Owner: -
2498 CREATE INDEX index_issues_on_updated_by ON public.issues USING btree (updated_by);
2502 -- Name: index_note_comments_on_author_id_and_created_at; Type: INDEX; Schema: public; Owner: -
2505 CREATE INDEX index_note_comments_on_author_id_and_created_at ON public.note_comments USING btree (author_id, created_at);
2509 -- Name: index_note_comments_on_body; Type: INDEX; Schema: public; Owner: -
2512 CREATE INDEX index_note_comments_on_body ON public.note_comments USING gin (to_tsvector('english'::regconfig, body));
2516 -- Name: index_note_comments_on_created_at; Type: INDEX; Schema: public; Owner: -
2519 CREATE INDEX index_note_comments_on_created_at ON public.note_comments USING btree (created_at);
2523 -- Name: index_note_subscriptions_on_note_id; Type: INDEX; Schema: public; Owner: -
2526 CREATE INDEX index_note_subscriptions_on_note_id ON public.note_subscriptions USING btree (note_id);
2530 -- Name: index_oauth_access_grants_on_application_id; Type: INDEX; Schema: public; Owner: -
2533 CREATE INDEX index_oauth_access_grants_on_application_id ON public.oauth_access_grants USING btree (application_id);
2537 -- Name: index_oauth_access_grants_on_resource_owner_id; Type: INDEX; Schema: public; Owner: -
2540 CREATE INDEX index_oauth_access_grants_on_resource_owner_id ON public.oauth_access_grants USING btree (resource_owner_id);
2544 -- Name: index_oauth_access_grants_on_token; Type: INDEX; Schema: public; Owner: -
2547 CREATE UNIQUE INDEX index_oauth_access_grants_on_token ON public.oauth_access_grants USING btree (token);
2551 -- Name: index_oauth_access_tokens_on_application_id; Type: INDEX; Schema: public; Owner: -
2554 CREATE INDEX index_oauth_access_tokens_on_application_id ON public.oauth_access_tokens USING btree (application_id);
2558 -- Name: index_oauth_access_tokens_on_refresh_token; Type: INDEX; Schema: public; Owner: -
2561 CREATE UNIQUE INDEX index_oauth_access_tokens_on_refresh_token ON public.oauth_access_tokens USING btree (refresh_token);
2565 -- Name: index_oauth_access_tokens_on_resource_owner_id; Type: INDEX; Schema: public; Owner: -
2568 CREATE INDEX index_oauth_access_tokens_on_resource_owner_id ON public.oauth_access_tokens USING btree (resource_owner_id);
2572 -- Name: index_oauth_access_tokens_on_token; Type: INDEX; Schema: public; Owner: -
2575 CREATE UNIQUE INDEX index_oauth_access_tokens_on_token ON public.oauth_access_tokens USING btree (token);
2579 -- Name: index_oauth_applications_on_owner_type_and_owner_id; Type: INDEX; Schema: public; Owner: -
2582 CREATE INDEX index_oauth_applications_on_owner_type_and_owner_id ON public.oauth_applications USING btree (owner_type, owner_id);
2586 -- Name: index_oauth_applications_on_uid; Type: INDEX; Schema: public; Owner: -
2589 CREATE UNIQUE INDEX index_oauth_applications_on_uid ON public.oauth_applications USING btree (uid);
2593 -- Name: index_oauth_openid_requests_on_access_grant_id; Type: INDEX; Schema: public; Owner: -
2596 CREATE INDEX index_oauth_openid_requests_on_access_grant_id ON public.oauth_openid_requests USING btree (access_grant_id);
2600 -- Name: index_reports_on_issue_id; Type: INDEX; Schema: public; Owner: -
2603 CREATE INDEX index_reports_on_issue_id ON public.reports USING btree (issue_id);
2607 -- Name: index_reports_on_user_id; Type: INDEX; Schema: public; Owner: -
2610 CREATE INDEX index_reports_on_user_id ON public.reports USING btree (user_id);
2614 -- Name: index_user_blocks_on_creator_id_and_id; Type: INDEX; Schema: public; Owner: -
2617 CREATE INDEX index_user_blocks_on_creator_id_and_id ON public.user_blocks USING btree (creator_id, id);
2621 -- Name: index_user_blocks_on_user_id; Type: INDEX; Schema: public; Owner: -
2624 CREATE INDEX index_user_blocks_on_user_id ON public.user_blocks USING btree (user_id);
2628 -- Name: index_user_mutes_on_owner_id_and_subject_id; Type: INDEX; Schema: public; Owner: -
2631 CREATE UNIQUE INDEX index_user_mutes_on_owner_id_and_subject_id ON public.user_mutes USING btree (owner_id, subject_id);
2635 -- Name: index_users_on_creation_address; Type: INDEX; Schema: public; Owner: -
2638 CREATE INDEX index_users_on_creation_address ON public.users USING gist (creation_address inet_ops);
2642 -- Name: messages_from_user_id_idx; Type: INDEX; Schema: public; Owner: -
2645 CREATE INDEX messages_from_user_id_idx ON public.messages USING btree (from_user_id);
2649 -- Name: messages_to_user_id_idx; Type: INDEX; Schema: public; Owner: -
2652 CREATE INDEX messages_to_user_id_idx ON public.messages USING btree (to_user_id);
2656 -- Name: nodes_changeset_id_idx; Type: INDEX; Schema: public; Owner: -
2659 CREATE INDEX nodes_changeset_id_idx ON public.nodes USING btree (changeset_id);
2663 -- Name: nodes_tile_idx; Type: INDEX; Schema: public; Owner: -
2666 CREATE INDEX nodes_tile_idx ON public.nodes USING btree (tile);
2670 -- Name: nodes_timestamp_idx; Type: INDEX; Schema: public; Owner: -
2673 CREATE INDEX nodes_timestamp_idx ON public.nodes USING btree ("timestamp");
2677 -- Name: note_comments_note_id_idx; Type: INDEX; Schema: public; Owner: -
2680 CREATE INDEX note_comments_note_id_idx ON public.note_comments USING btree (note_id);
2684 -- Name: notes_created_at_idx; Type: INDEX; Schema: public; Owner: -
2687 CREATE INDEX notes_created_at_idx ON public.notes USING btree (created_at);
2691 -- Name: notes_tile_status_idx; Type: INDEX; Schema: public; Owner: -
2694 CREATE INDEX notes_tile_status_idx ON public.notes USING btree (tile, status);
2698 -- Name: notes_updated_at_idx; Type: INDEX; Schema: public; Owner: -
2701 CREATE INDEX notes_updated_at_idx ON public.notes USING btree (updated_at);
2705 -- Name: points_gpxid_idx; Type: INDEX; Schema: public; Owner: -
2708 CREATE INDEX points_gpxid_idx ON public.gps_points USING btree (gpx_id);
2712 -- Name: points_tile_idx; Type: INDEX; Schema: public; Owner: -
2715 CREATE INDEX points_tile_idx ON public.gps_points USING btree (tile);
2719 -- Name: relation_members_member_idx; Type: INDEX; Schema: public; Owner: -
2722 CREATE INDEX relation_members_member_idx ON public.relation_members USING btree (member_type, member_id);
2726 -- Name: relations_changeset_id_idx; Type: INDEX; Schema: public; Owner: -
2729 CREATE INDEX relations_changeset_id_idx ON public.relations USING btree (changeset_id);
2733 -- Name: relations_timestamp_idx; Type: INDEX; Schema: public; Owner: -
2736 CREATE INDEX relations_timestamp_idx ON public.relations USING btree ("timestamp");
2740 -- Name: user_id_idx; Type: INDEX; Schema: public; Owner: -
2743 CREATE INDEX user_id_idx ON public.friends USING btree (friend_user_id);
2747 -- Name: user_roles_id_role_unique; Type: INDEX; Schema: public; Owner: -
2750 CREATE UNIQUE INDEX user_roles_id_role_unique ON public.user_roles USING btree (user_id, role);
2754 -- Name: users_auth_idx; Type: INDEX; Schema: public; Owner: -
2757 CREATE UNIQUE INDEX users_auth_idx ON public.users USING btree (auth_provider, auth_uid);
2761 -- Name: users_display_name_canonical_idx; Type: INDEX; Schema: public; Owner: -
2764 CREATE INDEX users_display_name_canonical_idx ON public.users USING btree (lower(NORMALIZE(display_name, NFKC)));
2768 -- Name: users_display_name_idx; Type: INDEX; Schema: public; Owner: -
2771 CREATE UNIQUE INDEX users_display_name_idx ON public.users USING btree (display_name);
2775 -- Name: users_email_idx; Type: INDEX; Schema: public; Owner: -
2778 CREATE UNIQUE INDEX users_email_idx ON public.users USING btree (email);
2782 -- Name: users_email_lower_idx; Type: INDEX; Schema: public; Owner: -
2785 CREATE INDEX users_email_lower_idx ON public.users USING btree (lower((email)::text));
2789 -- Name: users_home_idx; Type: INDEX; Schema: public; Owner: -
2792 CREATE INDEX users_home_idx ON public.users USING btree (home_tile);
2796 -- Name: way_nodes_node_idx; Type: INDEX; Schema: public; Owner: -
2799 CREATE INDEX way_nodes_node_idx ON public.way_nodes USING btree (node_id);
2803 -- Name: ways_changeset_id_idx; Type: INDEX; Schema: public; Owner: -
2806 CREATE INDEX ways_changeset_id_idx ON public.ways USING btree (changeset_id);
2810 -- Name: ways_timestamp_idx; Type: INDEX; Schema: public; Owner: -
2813 CREATE INDEX ways_timestamp_idx ON public.ways USING btree ("timestamp");
2817 -- Name: changeset_comments changeset_comments_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2820 ALTER TABLE ONLY public.changeset_comments
2821 ADD CONSTRAINT changeset_comments_author_id_fkey FOREIGN KEY (author_id) REFERENCES public.users(id);
2825 -- Name: changeset_comments changeset_comments_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2828 ALTER TABLE ONLY public.changeset_comments
2829 ADD CONSTRAINT changeset_comments_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES public.changesets(id);
2833 -- Name: changeset_tags changeset_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2836 ALTER TABLE ONLY public.changeset_tags
2837 ADD CONSTRAINT changeset_tags_id_fkey FOREIGN KEY (changeset_id) REFERENCES public.changesets(id);
2841 -- Name: changesets_subscribers changesets_subscribers_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2844 ALTER TABLE ONLY public.changesets_subscribers
2845 ADD CONSTRAINT changesets_subscribers_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES public.changesets(id);
2849 -- Name: changesets_subscribers changesets_subscribers_subscriber_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2852 ALTER TABLE ONLY public.changesets_subscribers
2853 ADD CONSTRAINT changesets_subscribers_subscriber_id_fkey FOREIGN KEY (subscriber_id) REFERENCES public.users(id);
2857 -- Name: changesets changesets_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2860 ALTER TABLE ONLY public.changesets
2861 ADD CONSTRAINT changesets_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);
2865 -- Name: current_node_tags current_node_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2868 ALTER TABLE ONLY public.current_node_tags
2869 ADD CONSTRAINT current_node_tags_id_fkey FOREIGN KEY (node_id) REFERENCES public.current_nodes(id);
2873 -- Name: current_nodes current_nodes_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2876 ALTER TABLE ONLY public.current_nodes
2877 ADD CONSTRAINT current_nodes_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES public.changesets(id);
2881 -- Name: current_relation_members current_relation_members_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2884 ALTER TABLE ONLY public.current_relation_members
2885 ADD CONSTRAINT current_relation_members_id_fkey FOREIGN KEY (relation_id) REFERENCES public.current_relations(id);
2889 -- Name: current_relation_tags current_relation_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2892 ALTER TABLE ONLY public.current_relation_tags
2893 ADD CONSTRAINT current_relation_tags_id_fkey FOREIGN KEY (relation_id) REFERENCES public.current_relations(id);
2897 -- Name: current_relations current_relations_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2900 ALTER TABLE ONLY public.current_relations
2901 ADD CONSTRAINT current_relations_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES public.changesets(id);
2905 -- Name: current_way_nodes current_way_nodes_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2908 ALTER TABLE ONLY public.current_way_nodes
2909 ADD CONSTRAINT current_way_nodes_id_fkey FOREIGN KEY (way_id) REFERENCES public.current_ways(id);
2913 -- Name: current_way_nodes current_way_nodes_node_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2916 ALTER TABLE ONLY public.current_way_nodes
2917 ADD CONSTRAINT current_way_nodes_node_id_fkey FOREIGN KEY (node_id) REFERENCES public.current_nodes(id);
2921 -- Name: current_way_tags current_way_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2924 ALTER TABLE ONLY public.current_way_tags
2925 ADD CONSTRAINT current_way_tags_id_fkey FOREIGN KEY (way_id) REFERENCES public.current_ways(id);
2929 -- Name: current_ways current_ways_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2932 ALTER TABLE ONLY public.current_ways
2933 ADD CONSTRAINT current_ways_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES public.changesets(id);
2937 -- Name: diary_comments diary_comments_diary_entry_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2940 ALTER TABLE ONLY public.diary_comments
2941 ADD CONSTRAINT diary_comments_diary_entry_id_fkey FOREIGN KEY (diary_entry_id) REFERENCES public.diary_entries(id);
2945 -- Name: diary_comments diary_comments_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2948 ALTER TABLE ONLY public.diary_comments
2949 ADD CONSTRAINT diary_comments_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);
2953 -- Name: diary_entries diary_entries_language_code_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2956 ALTER TABLE ONLY public.diary_entries
2957 ADD CONSTRAINT diary_entries_language_code_fkey FOREIGN KEY (language_code) REFERENCES public.languages(code);
2961 -- Name: diary_entries diary_entries_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2964 ALTER TABLE ONLY public.diary_entries
2965 ADD CONSTRAINT diary_entries_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);
2969 -- Name: diary_entry_subscriptions diary_entry_subscriptions_diary_entry_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2972 ALTER TABLE ONLY public.diary_entry_subscriptions
2973 ADD CONSTRAINT diary_entry_subscriptions_diary_entry_id_fkey FOREIGN KEY (diary_entry_id) REFERENCES public.diary_entries(id);
2977 -- Name: diary_entry_subscriptions diary_entry_subscriptions_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2980 ALTER TABLE ONLY public.diary_entry_subscriptions
2981 ADD CONSTRAINT diary_entry_subscriptions_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);
2985 -- Name: note_subscriptions fk_rails_2c1913f293; Type: FK CONSTRAINT; Schema: public; Owner: -
2988 ALTER TABLE ONLY public.note_subscriptions
2989 ADD CONSTRAINT fk_rails_2c1913f293 FOREIGN KEY (note_id) REFERENCES public.notes(id);
2993 -- Name: oauth_access_grants fk_rails_330c32d8d9; Type: FK CONSTRAINT; Schema: public; Owner: -
2996 ALTER TABLE ONLY public.oauth_access_grants
2997 ADD CONSTRAINT fk_rails_330c32d8d9 FOREIGN KEY (resource_owner_id) REFERENCES public.users(id) NOT VALID;
3001 -- Name: user_mutes fk_rails_591dad3359; Type: FK CONSTRAINT; Schema: public; Owner: -
3004 ALTER TABLE ONLY public.user_mutes
3005 ADD CONSTRAINT fk_rails_591dad3359 FOREIGN KEY (owner_id) REFERENCES public.users(id);
3009 -- Name: oauth_access_tokens fk_rails_732cb83ab7; Type: FK CONSTRAINT; Schema: public; Owner: -
3012 ALTER TABLE ONLY public.oauth_access_tokens
3013 ADD CONSTRAINT fk_rails_732cb83ab7 FOREIGN KEY (application_id) REFERENCES public.oauth_applications(id) NOT VALID;
3017 -- Name: oauth_openid_requests fk_rails_77114b3b09; Type: FK CONSTRAINT; Schema: public; Owner: -
3020 ALTER TABLE ONLY public.oauth_openid_requests
3021 ADD CONSTRAINT fk_rails_77114b3b09 FOREIGN KEY (access_grant_id) REFERENCES public.oauth_access_grants(id) ON DELETE CASCADE;
3025 -- Name: active_storage_variant_records fk_rails_993965df05; Type: FK CONSTRAINT; Schema: public; Owner: -
3028 ALTER TABLE ONLY public.active_storage_variant_records
3029 ADD CONSTRAINT fk_rails_993965df05 FOREIGN KEY (blob_id) REFERENCES public.active_storage_blobs(id);
3033 -- Name: note_subscriptions fk_rails_a352f4eced; Type: FK CONSTRAINT; Schema: public; Owner: -
3036 ALTER TABLE ONLY public.note_subscriptions
3037 ADD CONSTRAINT fk_rails_a352f4eced FOREIGN KEY (user_id) REFERENCES public.users(id);
3041 -- Name: oauth_access_grants fk_rails_b4b53e07b8; Type: FK CONSTRAINT; Schema: public; Owner: -
3044 ALTER TABLE ONLY public.oauth_access_grants
3045 ADD CONSTRAINT fk_rails_b4b53e07b8 FOREIGN KEY (application_id) REFERENCES public.oauth_applications(id) NOT VALID;
3049 -- Name: active_storage_attachments fk_rails_c3b3935057; Type: FK CONSTRAINT; Schema: public; Owner: -
3052 ALTER TABLE ONLY public.active_storage_attachments
3053 ADD CONSTRAINT fk_rails_c3b3935057 FOREIGN KEY (blob_id) REFERENCES public.active_storage_blobs(id);
3057 -- Name: oauth_applications fk_rails_cc886e315a; Type: FK CONSTRAINT; Schema: public; Owner: -
3060 ALTER TABLE ONLY public.oauth_applications
3061 ADD CONSTRAINT fk_rails_cc886e315a FOREIGN KEY (owner_id) REFERENCES public.users(id) NOT VALID;
3065 -- Name: user_mutes fk_rails_e9dd4fb6c3; Type: FK CONSTRAINT; Schema: public; Owner: -
3068 ALTER TABLE ONLY public.user_mutes
3069 ADD CONSTRAINT fk_rails_e9dd4fb6c3 FOREIGN KEY (subject_id) REFERENCES public.users(id);
3073 -- Name: oauth_access_tokens fk_rails_ee63f25419; Type: FK CONSTRAINT; Schema: public; Owner: -
3076 ALTER TABLE ONLY public.oauth_access_tokens
3077 ADD CONSTRAINT fk_rails_ee63f25419 FOREIGN KEY (resource_owner_id) REFERENCES public.users(id) NOT VALID;
3081 -- Name: friends friends_friend_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3084 ALTER TABLE ONLY public.friends
3085 ADD CONSTRAINT friends_friend_user_id_fkey FOREIGN KEY (friend_user_id) REFERENCES public.users(id);
3089 -- Name: friends friends_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3092 ALTER TABLE ONLY public.friends
3093 ADD CONSTRAINT friends_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);
3097 -- Name: gps_points gps_points_gpx_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3100 ALTER TABLE ONLY public.gps_points
3101 ADD CONSTRAINT gps_points_gpx_id_fkey FOREIGN KEY (gpx_id) REFERENCES public.gpx_files(id);
3105 -- Name: gpx_file_tags gpx_file_tags_gpx_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3108 ALTER TABLE ONLY public.gpx_file_tags
3109 ADD CONSTRAINT gpx_file_tags_gpx_id_fkey FOREIGN KEY (gpx_id) REFERENCES public.gpx_files(id);
3113 -- Name: gpx_files gpx_files_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3116 ALTER TABLE ONLY public.gpx_files
3117 ADD CONSTRAINT gpx_files_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);
3121 -- Name: issue_comments issue_comments_issue_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3124 ALTER TABLE ONLY public.issue_comments
3125 ADD CONSTRAINT issue_comments_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES public.issues(id);
3129 -- Name: issue_comments issue_comments_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3132 ALTER TABLE ONLY public.issue_comments
3133 ADD CONSTRAINT issue_comments_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);
3137 -- Name: issues issues_reported_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3140 ALTER TABLE ONLY public.issues
3141 ADD CONSTRAINT issues_reported_user_id_fkey FOREIGN KEY (reported_user_id) REFERENCES public.users(id);
3145 -- Name: issues issues_resolved_by_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3148 ALTER TABLE ONLY public.issues
3149 ADD CONSTRAINT issues_resolved_by_fkey FOREIGN KEY (resolved_by) REFERENCES public.users(id);
3153 -- Name: issues issues_updated_by_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3156 ALTER TABLE ONLY public.issues
3157 ADD CONSTRAINT issues_updated_by_fkey FOREIGN KEY (updated_by) REFERENCES public.users(id);
3161 -- Name: messages messages_from_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3164 ALTER TABLE ONLY public.messages
3165 ADD CONSTRAINT messages_from_user_id_fkey FOREIGN KEY (from_user_id) REFERENCES public.users(id);
3169 -- Name: messages messages_to_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3172 ALTER TABLE ONLY public.messages
3173 ADD CONSTRAINT messages_to_user_id_fkey FOREIGN KEY (to_user_id) REFERENCES public.users(id);
3177 -- Name: node_tags node_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3180 ALTER TABLE ONLY public.node_tags
3181 ADD CONSTRAINT node_tags_id_fkey FOREIGN KEY (node_id, version) REFERENCES public.nodes(node_id, version);
3185 -- Name: nodes nodes_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3188 ALTER TABLE ONLY public.nodes
3189 ADD CONSTRAINT nodes_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES public.changesets(id);
3193 -- Name: nodes nodes_redaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3196 ALTER TABLE ONLY public.nodes
3197 ADD CONSTRAINT nodes_redaction_id_fkey FOREIGN KEY (redaction_id) REFERENCES public.redactions(id);
3201 -- Name: note_comments note_comments_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3204 ALTER TABLE ONLY public.note_comments
3205 ADD CONSTRAINT note_comments_author_id_fkey FOREIGN KEY (author_id) REFERENCES public.users(id);
3209 -- Name: note_comments note_comments_note_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3212 ALTER TABLE ONLY public.note_comments
3213 ADD CONSTRAINT note_comments_note_id_fkey FOREIGN KEY (note_id) REFERENCES public.notes(id);
3217 -- Name: notes notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3220 ALTER TABLE ONLY public.notes
3221 ADD CONSTRAINT notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) NOT VALID;
3225 -- Name: redactions redactions_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3228 ALTER TABLE ONLY public.redactions
3229 ADD CONSTRAINT redactions_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);
3233 -- Name: relation_members relation_members_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3236 ALTER TABLE ONLY public.relation_members
3237 ADD CONSTRAINT relation_members_id_fkey FOREIGN KEY (relation_id, version) REFERENCES public.relations(relation_id, version);
3241 -- Name: relation_tags relation_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3244 ALTER TABLE ONLY public.relation_tags
3245 ADD CONSTRAINT relation_tags_id_fkey FOREIGN KEY (relation_id, version) REFERENCES public.relations(relation_id, version);
3249 -- Name: relations relations_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3252 ALTER TABLE ONLY public.relations
3253 ADD CONSTRAINT relations_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES public.changesets(id);
3257 -- Name: relations relations_redaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3260 ALTER TABLE ONLY public.relations
3261 ADD CONSTRAINT relations_redaction_id_fkey FOREIGN KEY (redaction_id) REFERENCES public.redactions(id);
3265 -- Name: reports reports_issue_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3268 ALTER TABLE ONLY public.reports
3269 ADD CONSTRAINT reports_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES public.issues(id);
3273 -- Name: reports reports_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3276 ALTER TABLE ONLY public.reports
3277 ADD CONSTRAINT reports_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);
3281 -- Name: user_blocks user_blocks_moderator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3284 ALTER TABLE ONLY public.user_blocks
3285 ADD CONSTRAINT user_blocks_moderator_id_fkey FOREIGN KEY (creator_id) REFERENCES public.users(id);
3289 -- Name: user_blocks user_blocks_revoker_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3292 ALTER TABLE ONLY public.user_blocks
3293 ADD CONSTRAINT user_blocks_revoker_id_fkey FOREIGN KEY (revoker_id) REFERENCES public.users(id);
3297 -- Name: user_blocks user_blocks_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3300 ALTER TABLE ONLY public.user_blocks
3301 ADD CONSTRAINT user_blocks_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);
3305 -- Name: user_preferences user_preferences_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3308 ALTER TABLE ONLY public.user_preferences
3309 ADD CONSTRAINT user_preferences_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);
3313 -- Name: user_roles user_roles_granter_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3316 ALTER TABLE ONLY public.user_roles
3317 ADD CONSTRAINT user_roles_granter_id_fkey FOREIGN KEY (granter_id) REFERENCES public.users(id);
3321 -- Name: user_roles user_roles_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3324 ALTER TABLE ONLY public.user_roles
3325 ADD CONSTRAINT user_roles_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);
3329 -- Name: way_nodes way_nodes_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3332 ALTER TABLE ONLY public.way_nodes
3333 ADD CONSTRAINT way_nodes_id_fkey FOREIGN KEY (way_id, version) REFERENCES public.ways(way_id, version);
3337 -- Name: way_tags way_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3340 ALTER TABLE ONLY public.way_tags
3341 ADD CONSTRAINT way_tags_id_fkey FOREIGN KEY (way_id, version) REFERENCES public.ways(way_id, version);
3345 -- Name: ways ways_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3348 ALTER TABLE ONLY public.ways
3349 ADD CONSTRAINT ways_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES public.changesets(id);
3353 -- Name: ways ways_redaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
3356 ALTER TABLE ONLY public.ways
3357 ADD CONSTRAINT ways_redaction_id_fkey FOREIGN KEY (redaction_id) REFERENCES public.redactions(id);
3361 -- PostgreSQL database dump complete
3364 SET search_path TO "$user", public;
3366 INSERT INTO "schema_migrations" (version) VALUES