2 -- PostgreSQL database dump
5 -- Dumped from database version 9.5.7
6 -- Dumped by pg_dump version 9.5.7
8 SET statement_timeout = 0;
10 SET client_encoding = 'UTF8';
11 SET standard_conforming_strings = on;
12 SET check_function_bodies = false;
13 SET client_min_messages = warning;
14 SET row_security = off;
17 -- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
20 CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
24 -- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
27 COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
31 -- Name: btree_gist; Type: EXTENSION; Schema: -; Owner: -
34 CREATE EXTENSION IF NOT EXISTS btree_gist WITH SCHEMA public;
38 -- Name: EXTENSION btree_gist; Type: COMMENT; Schema: -; Owner: -
41 COMMENT ON EXTENSION btree_gist IS 'support for indexing common datatypes in GiST';
44 SET search_path = public, pg_catalog;
47 -- Name: format_enum; Type: TYPE; Schema: public; Owner: -
50 CREATE TYPE format_enum AS ENUM (
58 -- Name: gpx_visibility_enum; Type: TYPE; Schema: public; Owner: -
61 CREATE TYPE gpx_visibility_enum AS ENUM (
70 -- Name: issue_status_enum; Type: TYPE; Schema: public; Owner: -
73 CREATE TYPE issue_status_enum AS ENUM (
81 -- Name: note_event_enum; Type: TYPE; Schema: public; Owner: -
84 CREATE TYPE note_event_enum AS ENUM (
94 -- Name: note_status_enum; Type: TYPE; Schema: public; Owner: -
97 CREATE TYPE note_status_enum AS ENUM (
105 -- Name: nwr_enum; Type: TYPE; Schema: public; Owner: -
108 CREATE TYPE nwr_enum AS ENUM (
116 -- Name: user_role_enum; Type: TYPE; Schema: public; Owner: -
119 CREATE TYPE user_role_enum AS ENUM (
126 -- Name: user_status_enum; Type: TYPE; Schema: public; Owner: -
129 CREATE TYPE user_status_enum AS ENUM (
139 -- Name: maptile_for_point(bigint, bigint, integer); Type: FUNCTION; Schema: public; Owner: -
142 CREATE FUNCTION maptile_for_point(bigint, bigint, integer) RETURNS integer
144 AS '$libdir/libpgosm', 'maptile_for_point';
148 -- Name: tile_for_point(integer, integer); Type: FUNCTION; Schema: public; Owner: -
151 CREATE FUNCTION tile_for_point(integer, integer) RETURNS bigint
153 AS '$libdir/libpgosm', 'tile_for_point';
157 -- Name: xid_to_int4(xid); Type: FUNCTION; Schema: public; Owner: -
160 CREATE FUNCTION xid_to_int4(xid) RETURNS integer
161 LANGUAGE c IMMUTABLE STRICT
162 AS '$libdir/libpgosm', 'xid_to_int4';
165 SET default_tablespace = '';
167 SET default_with_oids = false;
170 -- Name: acls; Type: TABLE; Schema: public; Owner: -
176 k character varying(255) NOT NULL,
177 v character varying(255),
178 domain character varying(255)
183 -- Name: acls_id_seq; Type: SEQUENCE; Schema: public; Owner: -
186 CREATE SEQUENCE acls_id_seq
195 -- Name: acls_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
198 ALTER SEQUENCE acls_id_seq OWNED BY acls.id;
202 -- Name: ar_internal_metadata; Type: TABLE; Schema: public; Owner: -
205 CREATE TABLE ar_internal_metadata (
206 key character varying NOT NULL,
207 value character varying,
208 created_at timestamp without time zone NOT NULL,
209 updated_at timestamp without time zone NOT NULL
214 -- Name: changeset_comments; Type: TABLE; Schema: public; Owner: -
217 CREATE TABLE changeset_comments (
219 changeset_id bigint NOT NULL,
220 author_id bigint NOT NULL,
222 created_at timestamp without time zone NOT NULL,
223 visible boolean NOT NULL
228 -- Name: changeset_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
231 CREATE SEQUENCE changeset_comments_id_seq
240 -- Name: changeset_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
243 ALTER SEQUENCE changeset_comments_id_seq OWNED BY changeset_comments.id;
247 -- Name: changeset_tags; Type: TABLE; Schema: public; Owner: -
250 CREATE TABLE changeset_tags (
251 changeset_id bigint NOT NULL,
252 k character varying(255) DEFAULT ''::character varying NOT NULL,
253 v character varying(255) DEFAULT ''::character varying NOT NULL
258 -- Name: changesets; Type: TABLE; Schema: public; Owner: -
261 CREATE TABLE changesets (
263 user_id bigint NOT NULL,
264 created_at timestamp without time zone NOT NULL,
269 closed_at timestamp without time zone NOT NULL,
270 num_changes integer DEFAULT 0 NOT NULL
275 -- Name: changesets_id_seq; Type: SEQUENCE; Schema: public; Owner: -
278 CREATE SEQUENCE changesets_id_seq
287 -- Name: changesets_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
290 ALTER SEQUENCE changesets_id_seq OWNED BY changesets.id;
294 -- Name: changesets_subscribers; Type: TABLE; Schema: public; Owner: -
297 CREATE TABLE changesets_subscribers (
298 subscriber_id bigint NOT NULL,
299 changeset_id bigint NOT NULL
304 -- Name: client_applications; Type: TABLE; Schema: public; Owner: -
307 CREATE TABLE client_applications (
309 name character varying(255),
310 url character varying(255),
311 support_url character varying(255),
312 callback_url character varying(255),
313 key character varying(50),
314 secret character varying(50),
316 created_at timestamp without time zone,
317 updated_at timestamp without time zone,
318 allow_read_prefs boolean DEFAULT false NOT NULL,
319 allow_write_prefs boolean DEFAULT false NOT NULL,
320 allow_write_diary boolean DEFAULT false NOT NULL,
321 allow_write_api boolean DEFAULT false NOT NULL,
322 allow_read_gpx boolean DEFAULT false NOT NULL,
323 allow_write_gpx boolean DEFAULT false NOT NULL,
324 allow_write_notes boolean DEFAULT false NOT NULL
329 -- Name: client_applications_id_seq; Type: SEQUENCE; Schema: public; Owner: -
332 CREATE SEQUENCE client_applications_id_seq
341 -- Name: client_applications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
344 ALTER SEQUENCE client_applications_id_seq OWNED BY client_applications.id;
348 -- Name: current_node_tags; Type: TABLE; Schema: public; Owner: -
351 CREATE TABLE current_node_tags (
352 node_id bigint NOT NULL,
353 k character varying(255) DEFAULT ''::character varying NOT NULL,
354 v character varying(255) DEFAULT ''::character varying NOT NULL
359 -- Name: current_nodes; Type: TABLE; Schema: public; Owner: -
362 CREATE TABLE current_nodes (
364 latitude integer NOT NULL,
365 longitude integer NOT NULL,
366 changeset_id bigint NOT NULL,
367 visible boolean NOT NULL,
368 "timestamp" timestamp without time zone NOT NULL,
369 tile bigint NOT NULL,
370 version bigint NOT NULL
375 -- Name: current_nodes_id_seq; Type: SEQUENCE; Schema: public; Owner: -
378 CREATE SEQUENCE current_nodes_id_seq
387 -- Name: current_nodes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
390 ALTER SEQUENCE current_nodes_id_seq OWNED BY current_nodes.id;
394 -- Name: current_relation_members; Type: TABLE; Schema: public; Owner: -
397 CREATE TABLE current_relation_members (
398 relation_id bigint NOT NULL,
399 member_type nwr_enum NOT NULL,
400 member_id bigint NOT NULL,
401 member_role character varying(255) NOT NULL,
402 sequence_id integer DEFAULT 0 NOT NULL
407 -- Name: current_relation_tags; Type: TABLE; Schema: public; Owner: -
410 CREATE TABLE current_relation_tags (
411 relation_id bigint NOT NULL,
412 k character varying(255) DEFAULT ''::character varying NOT NULL,
413 v character varying(255) DEFAULT ''::character varying NOT NULL
418 -- Name: current_relations; Type: TABLE; Schema: public; Owner: -
421 CREATE TABLE current_relations (
423 changeset_id bigint NOT NULL,
424 "timestamp" timestamp without time zone NOT NULL,
425 visible boolean NOT NULL,
426 version bigint NOT NULL
431 -- Name: current_relations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
434 CREATE SEQUENCE current_relations_id_seq
443 -- Name: current_relations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
446 ALTER SEQUENCE current_relations_id_seq OWNED BY current_relations.id;
450 -- Name: current_way_nodes; Type: TABLE; Schema: public; Owner: -
453 CREATE TABLE current_way_nodes (
454 way_id bigint NOT NULL,
455 node_id bigint NOT NULL,
456 sequence_id bigint NOT NULL
461 -- Name: current_way_tags; Type: TABLE; Schema: public; Owner: -
464 CREATE TABLE current_way_tags (
465 way_id bigint NOT NULL,
466 k character varying(255) DEFAULT ''::character varying NOT NULL,
467 v character varying(255) DEFAULT ''::character varying NOT NULL
472 -- Name: current_ways; Type: TABLE; Schema: public; Owner: -
475 CREATE TABLE current_ways (
477 changeset_id bigint NOT NULL,
478 "timestamp" timestamp without time zone NOT NULL,
479 visible boolean NOT NULL,
480 version bigint NOT NULL
485 -- Name: current_ways_id_seq; Type: SEQUENCE; Schema: public; Owner: -
488 CREATE SEQUENCE current_ways_id_seq
497 -- Name: current_ways_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
500 ALTER SEQUENCE current_ways_id_seq OWNED BY current_ways.id;
504 -- Name: diary_comments; Type: TABLE; Schema: public; Owner: -
507 CREATE TABLE diary_comments (
509 diary_entry_id bigint NOT NULL,
510 user_id bigint NOT NULL,
512 created_at timestamp without time zone NOT NULL,
513 updated_at timestamp without time zone NOT NULL,
514 visible boolean DEFAULT true NOT NULL,
515 body_format format_enum DEFAULT 'markdown'::format_enum NOT NULL
520 -- Name: diary_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
523 CREATE SEQUENCE diary_comments_id_seq
532 -- Name: diary_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
535 ALTER SEQUENCE diary_comments_id_seq OWNED BY diary_comments.id;
539 -- Name: diary_entries; Type: TABLE; Schema: public; Owner: -
542 CREATE TABLE diary_entries (
544 user_id bigint NOT NULL,
545 title character varying(255) NOT NULL,
547 created_at timestamp without time zone NOT NULL,
548 updated_at timestamp without time zone NOT NULL,
549 latitude double precision,
550 longitude double precision,
551 language_code character varying(255) DEFAULT 'en'::character varying NOT NULL,
552 visible boolean DEFAULT true NOT NULL,
553 body_format format_enum DEFAULT 'markdown'::format_enum NOT NULL
558 -- Name: diary_entries_id_seq; Type: SEQUENCE; Schema: public; Owner: -
561 CREATE SEQUENCE diary_entries_id_seq
570 -- Name: diary_entries_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
573 ALTER SEQUENCE diary_entries_id_seq OWNED BY diary_entries.id;
577 -- Name: diary_entry_subscriptions; Type: TABLE; Schema: public; Owner: -
580 CREATE TABLE diary_entry_subscriptions (
581 user_id bigint NOT NULL,
582 diary_entry_id bigint NOT NULL
587 -- Name: friends; Type: TABLE; Schema: public; Owner: -
590 CREATE TABLE friends (
592 user_id bigint NOT NULL,
593 friend_user_id bigint NOT NULL
598 -- Name: friends_id_seq; Type: SEQUENCE; Schema: public; Owner: -
601 CREATE SEQUENCE friends_id_seq
610 -- Name: friends_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
613 ALTER SEQUENCE friends_id_seq OWNED BY friends.id;
617 -- Name: gps_points; Type: TABLE; Schema: public; Owner: -
620 CREATE TABLE gps_points (
621 altitude double precision,
622 trackid integer NOT NULL,
623 latitude integer NOT NULL,
624 longitude integer NOT NULL,
625 gpx_id bigint NOT NULL,
626 "timestamp" timestamp without time zone,
632 -- Name: gpx_file_tags; Type: TABLE; Schema: public; Owner: -
635 CREATE TABLE gpx_file_tags (
636 gpx_id bigint DEFAULT 0 NOT NULL,
637 tag character varying(255) NOT NULL,
643 -- Name: gpx_file_tags_id_seq; Type: SEQUENCE; Schema: public; Owner: -
646 CREATE SEQUENCE gpx_file_tags_id_seq
655 -- Name: gpx_file_tags_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
658 ALTER SEQUENCE gpx_file_tags_id_seq OWNED BY gpx_file_tags.id;
662 -- Name: gpx_files; Type: TABLE; Schema: public; Owner: -
665 CREATE TABLE gpx_files (
667 user_id bigint NOT NULL,
668 visible boolean DEFAULT true NOT NULL,
669 name character varying(255) DEFAULT ''::character varying NOT NULL,
671 latitude double precision,
672 longitude double precision,
673 "timestamp" timestamp without time zone NOT NULL,
674 description character varying(255) DEFAULT ''::character varying NOT NULL,
675 inserted boolean NOT NULL,
676 visibility gpx_visibility_enum DEFAULT 'public'::gpx_visibility_enum NOT NULL
681 -- Name: gpx_files_id_seq; Type: SEQUENCE; Schema: public; Owner: -
684 CREATE SEQUENCE gpx_files_id_seq
693 -- Name: gpx_files_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
696 ALTER SEQUENCE gpx_files_id_seq OWNED BY gpx_files.id;
700 -- Name: issue_comments; Type: TABLE; Schema: public; Owner: -
703 CREATE TABLE issue_comments (
705 issue_id integer NOT NULL,
706 user_id integer NOT NULL,
708 created_at timestamp without time zone NOT NULL,
709 updated_at timestamp without time zone NOT NULL
714 -- Name: issue_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
717 CREATE SEQUENCE issue_comments_id_seq
726 -- Name: issue_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
729 ALTER SEQUENCE issue_comments_id_seq OWNED BY issue_comments.id;
733 -- Name: issues; Type: TABLE; Schema: public; Owner: -
736 CREATE TABLE issues (
738 reportable_type character varying NOT NULL,
739 reportable_id integer NOT NULL,
740 reported_user_id integer,
741 status issue_status_enum DEFAULT 'open'::public.issue_status_enum NOT NULL,
742 assigned_role user_role_enum NOT NULL,
743 resolved_at timestamp without time zone,
746 reports_count integer DEFAULT 0,
747 created_at timestamp without time zone NOT NULL,
748 updated_at timestamp without time zone NOT NULL
753 -- Name: issues_id_seq; Type: SEQUENCE; Schema: public; Owner: -
756 CREATE SEQUENCE issues_id_seq
765 -- Name: issues_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
768 ALTER SEQUENCE issues_id_seq OWNED BY issues.id;
772 -- Name: languages; Type: TABLE; Schema: public; Owner: -
775 CREATE TABLE languages (
776 code character varying(255) NOT NULL,
777 english_name character varying(255) NOT NULL,
778 native_name character varying(255)
783 -- Name: messages; Type: TABLE; Schema: public; Owner: -
786 CREATE TABLE messages (
788 from_user_id bigint NOT NULL,
789 title character varying(255) NOT NULL,
791 sent_on timestamp without time zone NOT NULL,
792 message_read boolean DEFAULT false NOT NULL,
793 to_user_id bigint NOT NULL,
794 to_user_visible boolean DEFAULT true NOT NULL,
795 from_user_visible boolean DEFAULT true NOT NULL,
796 body_format format_enum DEFAULT 'markdown'::format_enum NOT NULL
801 -- Name: messages_id_seq; Type: SEQUENCE; Schema: public; Owner: -
804 CREATE SEQUENCE messages_id_seq
813 -- Name: messages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
816 ALTER SEQUENCE messages_id_seq OWNED BY messages.id;
820 -- Name: node_tags; Type: TABLE; Schema: public; Owner: -
823 CREATE TABLE node_tags (
824 node_id bigint NOT NULL,
825 version bigint NOT NULL,
826 k character varying(255) DEFAULT ''::character varying NOT NULL,
827 v character varying(255) DEFAULT ''::character varying NOT NULL
832 -- Name: nodes; Type: TABLE; Schema: public; Owner: -
836 node_id bigint NOT NULL,
837 latitude integer NOT NULL,
838 longitude integer NOT NULL,
839 changeset_id bigint NOT NULL,
840 visible boolean NOT NULL,
841 "timestamp" timestamp without time zone NOT NULL,
842 tile bigint NOT NULL,
843 version bigint NOT NULL,
849 -- Name: note_comments; Type: TABLE; Schema: public; Owner: -
852 CREATE TABLE note_comments (
854 note_id bigint NOT NULL,
855 visible boolean NOT NULL,
856 created_at timestamp without time zone NOT NULL,
860 event note_event_enum
865 -- Name: note_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
868 CREATE SEQUENCE note_comments_id_seq
877 -- Name: note_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
880 ALTER SEQUENCE note_comments_id_seq OWNED BY note_comments.id;
884 -- Name: notes; Type: TABLE; Schema: public; Owner: -
889 latitude integer NOT NULL,
890 longitude integer NOT NULL,
891 tile bigint NOT NULL,
892 updated_at timestamp without time zone NOT NULL,
893 created_at timestamp without time zone NOT NULL,
894 status note_status_enum NOT NULL,
895 closed_at timestamp without time zone
900 -- Name: notes_id_seq; Type: SEQUENCE; Schema: public; Owner: -
903 CREATE SEQUENCE notes_id_seq
912 -- Name: notes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
915 ALTER SEQUENCE notes_id_seq OWNED BY notes.id;
919 -- Name: oauth_nonces; Type: TABLE; Schema: public; Owner: -
922 CREATE TABLE oauth_nonces (
924 nonce character varying(255),
926 created_at timestamp without time zone,
927 updated_at timestamp without time zone
932 -- Name: oauth_nonces_id_seq; Type: SEQUENCE; Schema: public; Owner: -
935 CREATE SEQUENCE oauth_nonces_id_seq
944 -- Name: oauth_nonces_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
947 ALTER SEQUENCE oauth_nonces_id_seq OWNED BY oauth_nonces.id;
951 -- Name: oauth_tokens; Type: TABLE; Schema: public; Owner: -
954 CREATE TABLE oauth_tokens (
957 type character varying(20),
958 client_application_id integer,
959 token character varying(50),
960 secret character varying(50),
961 authorized_at timestamp without time zone,
962 invalidated_at timestamp without time zone,
963 created_at timestamp without time zone,
964 updated_at timestamp without time zone,
965 allow_read_prefs boolean DEFAULT false NOT NULL,
966 allow_write_prefs boolean DEFAULT false NOT NULL,
967 allow_write_diary boolean DEFAULT false NOT NULL,
968 allow_write_api boolean DEFAULT false NOT NULL,
969 allow_read_gpx boolean DEFAULT false NOT NULL,
970 allow_write_gpx boolean DEFAULT false NOT NULL,
971 callback_url character varying(255),
972 verifier character varying(20),
973 scope character varying(255),
974 valid_to timestamp without time zone,
975 allow_write_notes boolean DEFAULT false NOT NULL
980 -- Name: oauth_tokens_id_seq; Type: SEQUENCE; Schema: public; Owner: -
983 CREATE SEQUENCE oauth_tokens_id_seq
992 -- Name: oauth_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
995 ALTER SEQUENCE oauth_tokens_id_seq OWNED BY oauth_tokens.id;
999 -- Name: redactions; Type: TABLE; Schema: public; Owner: -
1002 CREATE TABLE redactions (
1003 id integer NOT NULL,
1004 title character varying(255),
1006 created_at timestamp without time zone NOT NULL,
1007 updated_at timestamp without time zone NOT NULL,
1008 user_id bigint NOT NULL,
1009 description_format format_enum DEFAULT 'markdown'::format_enum NOT NULL
1014 -- Name: redactions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1017 CREATE SEQUENCE redactions_id_seq
1026 -- Name: redactions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1029 ALTER SEQUENCE redactions_id_seq OWNED BY redactions.id;
1033 -- Name: relation_members; Type: TABLE; Schema: public; Owner: -
1036 CREATE TABLE relation_members (
1037 relation_id bigint DEFAULT 0 NOT NULL,
1038 member_type nwr_enum NOT NULL,
1039 member_id bigint NOT NULL,
1040 member_role character varying(255) NOT NULL,
1041 version bigint DEFAULT 0 NOT NULL,
1042 sequence_id integer DEFAULT 0 NOT NULL
1047 -- Name: relation_tags; Type: TABLE; Schema: public; Owner: -
1050 CREATE TABLE relation_tags (
1051 relation_id bigint DEFAULT 0 NOT NULL,
1052 k character varying(255) DEFAULT ''::character varying NOT NULL,
1053 v character varying(255) DEFAULT ''::character varying NOT NULL,
1054 version bigint NOT NULL
1059 -- Name: relations; Type: TABLE; Schema: public; Owner: -
1062 CREATE TABLE relations (
1063 relation_id bigint DEFAULT 0 NOT NULL,
1064 changeset_id bigint NOT NULL,
1065 "timestamp" timestamp without time zone NOT NULL,
1066 version bigint NOT NULL,
1067 visible boolean DEFAULT true NOT NULL,
1068 redaction_id integer
1073 -- Name: reports; Type: TABLE; Schema: public; Owner: -
1076 CREATE TABLE reports (
1077 id integer NOT NULL,
1078 issue_id integer NOT NULL,
1079 user_id integer NOT NULL,
1080 details text NOT NULL,
1081 category character varying NOT NULL,
1082 created_at timestamp without time zone NOT NULL,
1083 updated_at timestamp without time zone NOT NULL
1088 -- Name: reports_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1091 CREATE SEQUENCE reports_id_seq
1100 -- Name: reports_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1103 ALTER SEQUENCE reports_id_seq OWNED BY reports.id;
1107 -- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -
1110 CREATE TABLE schema_migrations (
1111 version character varying(255) NOT NULL
1116 -- Name: user_blocks; Type: TABLE; Schema: public; Owner: -
1119 CREATE TABLE user_blocks (
1120 id integer NOT NULL,
1121 user_id bigint NOT NULL,
1122 creator_id bigint NOT NULL,
1123 reason text NOT NULL,
1124 ends_at timestamp without time zone NOT NULL,
1125 needs_view boolean DEFAULT false NOT NULL,
1127 created_at timestamp without time zone,
1128 updated_at timestamp without time zone,
1129 reason_format format_enum DEFAULT 'markdown'::format_enum NOT NULL
1134 -- Name: user_blocks_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1137 CREATE SEQUENCE user_blocks_id_seq
1146 -- Name: user_blocks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1149 ALTER SEQUENCE user_blocks_id_seq OWNED BY user_blocks.id;
1153 -- Name: user_preferences; Type: TABLE; Schema: public; Owner: -
1156 CREATE TABLE user_preferences (
1157 user_id bigint NOT NULL,
1158 k character varying(255) NOT NULL,
1159 v character varying(255) NOT NULL
1164 -- Name: user_roles; Type: TABLE; Schema: public; Owner: -
1167 CREATE TABLE user_roles (
1168 id integer NOT NULL,
1169 user_id bigint NOT NULL,
1170 created_at timestamp without time zone,
1171 updated_at timestamp without time zone,
1172 role user_role_enum NOT NULL,
1173 granter_id bigint NOT NULL
1178 -- Name: user_roles_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1181 CREATE SEQUENCE user_roles_id_seq
1190 -- Name: user_roles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1193 ALTER SEQUENCE user_roles_id_seq OWNED BY user_roles.id;
1197 -- Name: user_tokens; Type: TABLE; Schema: public; Owner: -
1200 CREATE TABLE user_tokens (
1202 user_id bigint NOT NULL,
1203 token character varying(255) NOT NULL,
1204 expiry timestamp without time zone NOT NULL,
1210 -- Name: user_tokens_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1213 CREATE SEQUENCE user_tokens_id_seq
1222 -- Name: user_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1225 ALTER SEQUENCE user_tokens_id_seq OWNED BY user_tokens.id;
1229 -- Name: users; Type: TABLE; Schema: public; Owner: -
1232 CREATE TABLE users (
1233 email character varying(255) NOT NULL,
1235 pass_crypt character varying(255) NOT NULL,
1236 creation_time timestamp without time zone NOT NULL,
1237 display_name character varying(255) DEFAULT ''::character varying NOT NULL,
1238 data_public boolean DEFAULT false NOT NULL,
1239 description text DEFAULT ''::text NOT NULL,
1240 home_lat double precision,
1241 home_lon double precision,
1242 home_zoom smallint DEFAULT 3,
1243 nearby integer DEFAULT 50,
1244 pass_salt character varying(255),
1245 image_file_name text,
1246 email_valid boolean DEFAULT false NOT NULL,
1247 new_email character varying(255),
1248 creation_ip character varying(255),
1249 languages character varying(255),
1250 status user_status_enum DEFAULT 'pending'::user_status_enum NOT NULL,
1251 terms_agreed timestamp without time zone,
1252 consider_pd boolean DEFAULT false NOT NULL,
1253 preferred_editor character varying(255),
1254 terms_seen boolean DEFAULT false NOT NULL,
1255 auth_uid character varying(255),
1256 description_format format_enum DEFAULT 'markdown'::format_enum NOT NULL,
1257 image_fingerprint character varying(255),
1258 changesets_count integer DEFAULT 0 NOT NULL,
1259 traces_count integer DEFAULT 0 NOT NULL,
1260 diary_entries_count integer DEFAULT 0 NOT NULL,
1261 image_use_gravatar boolean DEFAULT false NOT NULL,
1262 image_content_type character varying(255),
1263 auth_provider character varying
1268 -- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1271 CREATE SEQUENCE users_id_seq
1280 -- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1283 ALTER SEQUENCE users_id_seq OWNED BY users.id;
1287 -- Name: way_nodes; Type: TABLE; Schema: public; Owner: -
1290 CREATE TABLE way_nodes (
1291 way_id bigint NOT NULL,
1292 node_id bigint NOT NULL,
1293 version bigint NOT NULL,
1294 sequence_id bigint NOT NULL
1299 -- Name: way_tags; Type: TABLE; Schema: public; Owner: -
1302 CREATE TABLE way_tags (
1303 way_id bigint DEFAULT 0 NOT NULL,
1304 k character varying(255) NOT NULL,
1305 v character varying(255) NOT NULL,
1306 version bigint NOT NULL
1311 -- Name: ways; Type: TABLE; Schema: public; Owner: -
1315 way_id bigint DEFAULT 0 NOT NULL,
1316 changeset_id bigint NOT NULL,
1317 "timestamp" timestamp without time zone NOT NULL,
1318 version bigint NOT NULL,
1319 visible boolean DEFAULT true NOT NULL,
1320 redaction_id integer
1325 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1328 ALTER TABLE ONLY acls ALTER COLUMN id SET DEFAULT nextval('acls_id_seq'::regclass);
1332 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1335 ALTER TABLE ONLY changeset_comments ALTER COLUMN id SET DEFAULT nextval('changeset_comments_id_seq'::regclass);
1339 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1342 ALTER TABLE ONLY changesets ALTER COLUMN id SET DEFAULT nextval('changesets_id_seq'::regclass);
1346 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1349 ALTER TABLE ONLY client_applications ALTER COLUMN id SET DEFAULT nextval('client_applications_id_seq'::regclass);
1353 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1356 ALTER TABLE ONLY current_nodes ALTER COLUMN id SET DEFAULT nextval('current_nodes_id_seq'::regclass);
1360 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1363 ALTER TABLE ONLY current_relations ALTER COLUMN id SET DEFAULT nextval('current_relations_id_seq'::regclass);
1367 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1370 ALTER TABLE ONLY current_ways ALTER COLUMN id SET DEFAULT nextval('current_ways_id_seq'::regclass);
1374 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1377 ALTER TABLE ONLY diary_comments ALTER COLUMN id SET DEFAULT nextval('diary_comments_id_seq'::regclass);
1381 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1384 ALTER TABLE ONLY diary_entries ALTER COLUMN id SET DEFAULT nextval('diary_entries_id_seq'::regclass);
1388 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1391 ALTER TABLE ONLY friends ALTER COLUMN id SET DEFAULT nextval('friends_id_seq'::regclass);
1395 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1398 ALTER TABLE ONLY gpx_file_tags ALTER COLUMN id SET DEFAULT nextval('gpx_file_tags_id_seq'::regclass);
1402 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1405 ALTER TABLE ONLY gpx_files ALTER COLUMN id SET DEFAULT nextval('gpx_files_id_seq'::regclass);
1409 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1412 ALTER TABLE ONLY issue_comments ALTER COLUMN id SET DEFAULT nextval('issue_comments_id_seq'::regclass);
1416 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1419 ALTER TABLE ONLY issues ALTER COLUMN id SET DEFAULT nextval('issues_id_seq'::regclass);
1423 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1426 ALTER TABLE ONLY messages ALTER COLUMN id SET DEFAULT nextval('messages_id_seq'::regclass);
1430 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1433 ALTER TABLE ONLY note_comments ALTER COLUMN id SET DEFAULT nextval('note_comments_id_seq'::regclass);
1437 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1440 ALTER TABLE ONLY notes ALTER COLUMN id SET DEFAULT nextval('notes_id_seq'::regclass);
1444 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1447 ALTER TABLE ONLY oauth_nonces ALTER COLUMN id SET DEFAULT nextval('oauth_nonces_id_seq'::regclass);
1451 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1454 ALTER TABLE ONLY oauth_tokens ALTER COLUMN id SET DEFAULT nextval('oauth_tokens_id_seq'::regclass);
1458 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1461 ALTER TABLE ONLY redactions ALTER COLUMN id SET DEFAULT nextval('redactions_id_seq'::regclass);
1465 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1468 ALTER TABLE ONLY reports ALTER COLUMN id SET DEFAULT nextval('reports_id_seq'::regclass);
1472 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1475 ALTER TABLE ONLY user_blocks ALTER COLUMN id SET DEFAULT nextval('user_blocks_id_seq'::regclass);
1479 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1482 ALTER TABLE ONLY user_roles ALTER COLUMN id SET DEFAULT nextval('user_roles_id_seq'::regclass);
1486 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1489 ALTER TABLE ONLY user_tokens ALTER COLUMN id SET DEFAULT nextval('user_tokens_id_seq'::regclass);
1493 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1496 ALTER TABLE ONLY users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass);
1500 -- Name: acls_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1503 ALTER TABLE ONLY acls
1504 ADD CONSTRAINT acls_pkey PRIMARY KEY (id);
1508 -- Name: ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1511 ALTER TABLE ONLY ar_internal_metadata
1512 ADD CONSTRAINT ar_internal_metadata_pkey PRIMARY KEY (key);
1516 -- Name: changeset_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1519 ALTER TABLE ONLY changeset_comments
1520 ADD CONSTRAINT changeset_comments_pkey PRIMARY KEY (id);
1524 -- Name: changesets_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1527 ALTER TABLE ONLY changesets
1528 ADD CONSTRAINT changesets_pkey PRIMARY KEY (id);
1532 -- Name: client_applications_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1535 ALTER TABLE ONLY client_applications
1536 ADD CONSTRAINT client_applications_pkey PRIMARY KEY (id);
1540 -- Name: current_node_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1543 ALTER TABLE ONLY current_node_tags
1544 ADD CONSTRAINT current_node_tags_pkey PRIMARY KEY (node_id, k);
1548 -- Name: current_nodes_pkey1; Type: CONSTRAINT; Schema: public; Owner: -
1551 ALTER TABLE ONLY current_nodes
1552 ADD CONSTRAINT current_nodes_pkey1 PRIMARY KEY (id);
1556 -- Name: current_relation_members_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1559 ALTER TABLE ONLY current_relation_members
1560 ADD CONSTRAINT current_relation_members_pkey PRIMARY KEY (relation_id, member_type, member_id, member_role, sequence_id);
1564 -- Name: current_relation_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1567 ALTER TABLE ONLY current_relation_tags
1568 ADD CONSTRAINT current_relation_tags_pkey PRIMARY KEY (relation_id, k);
1572 -- Name: current_relations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1575 ALTER TABLE ONLY current_relations
1576 ADD CONSTRAINT current_relations_pkey PRIMARY KEY (id);
1580 -- Name: current_way_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1583 ALTER TABLE ONLY current_way_nodes
1584 ADD CONSTRAINT current_way_nodes_pkey PRIMARY KEY (way_id, sequence_id);
1588 -- Name: current_way_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1591 ALTER TABLE ONLY current_way_tags
1592 ADD CONSTRAINT current_way_tags_pkey PRIMARY KEY (way_id, k);
1596 -- Name: current_ways_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1599 ALTER TABLE ONLY current_ways
1600 ADD CONSTRAINT current_ways_pkey PRIMARY KEY (id);
1604 -- Name: diary_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1607 ALTER TABLE ONLY diary_comments
1608 ADD CONSTRAINT diary_comments_pkey PRIMARY KEY (id);
1612 -- Name: diary_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1615 ALTER TABLE ONLY diary_entries
1616 ADD CONSTRAINT diary_entries_pkey PRIMARY KEY (id);
1620 -- Name: diary_entry_subscriptions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1623 ALTER TABLE ONLY diary_entry_subscriptions
1624 ADD CONSTRAINT diary_entry_subscriptions_pkey PRIMARY KEY (user_id, diary_entry_id);
1628 -- Name: friends_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1631 ALTER TABLE ONLY friends
1632 ADD CONSTRAINT friends_pkey PRIMARY KEY (id);
1636 -- Name: gpx_file_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1639 ALTER TABLE ONLY gpx_file_tags
1640 ADD CONSTRAINT gpx_file_tags_pkey PRIMARY KEY (id);
1644 -- Name: gpx_files_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1647 ALTER TABLE ONLY gpx_files
1648 ADD CONSTRAINT gpx_files_pkey PRIMARY KEY (id);
1652 -- Name: issue_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1655 ALTER TABLE ONLY issue_comments
1656 ADD CONSTRAINT issue_comments_pkey PRIMARY KEY (id);
1660 -- Name: issues_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1663 ALTER TABLE ONLY issues
1664 ADD CONSTRAINT issues_pkey PRIMARY KEY (id);
1668 -- Name: languages_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1671 ALTER TABLE ONLY languages
1672 ADD CONSTRAINT languages_pkey PRIMARY KEY (code);
1676 -- Name: messages_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1679 ALTER TABLE ONLY messages
1680 ADD CONSTRAINT messages_pkey PRIMARY KEY (id);
1684 -- Name: node_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1687 ALTER TABLE ONLY node_tags
1688 ADD CONSTRAINT node_tags_pkey PRIMARY KEY (node_id, version, k);
1692 -- Name: nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1695 ALTER TABLE ONLY nodes
1696 ADD CONSTRAINT nodes_pkey PRIMARY KEY (node_id, version);
1700 -- Name: note_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1703 ALTER TABLE ONLY note_comments
1704 ADD CONSTRAINT note_comments_pkey PRIMARY KEY (id);
1708 -- Name: notes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1711 ALTER TABLE ONLY notes
1712 ADD CONSTRAINT notes_pkey PRIMARY KEY (id);
1716 -- Name: oauth_nonces_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1719 ALTER TABLE ONLY oauth_nonces
1720 ADD CONSTRAINT oauth_nonces_pkey PRIMARY KEY (id);
1724 -- Name: oauth_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1727 ALTER TABLE ONLY oauth_tokens
1728 ADD CONSTRAINT oauth_tokens_pkey PRIMARY KEY (id);
1732 -- Name: redactions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1735 ALTER TABLE ONLY redactions
1736 ADD CONSTRAINT redactions_pkey PRIMARY KEY (id);
1740 -- Name: relation_members_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1743 ALTER TABLE ONLY relation_members
1744 ADD CONSTRAINT relation_members_pkey PRIMARY KEY (relation_id, version, member_type, member_id, member_role, sequence_id);
1748 -- Name: relation_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1751 ALTER TABLE ONLY relation_tags
1752 ADD CONSTRAINT relation_tags_pkey PRIMARY KEY (relation_id, version, k);
1756 -- Name: relations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1759 ALTER TABLE ONLY relations
1760 ADD CONSTRAINT relations_pkey PRIMARY KEY (relation_id, version);
1764 -- Name: reports_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1767 ALTER TABLE ONLY reports
1768 ADD CONSTRAINT reports_pkey PRIMARY KEY (id);
1772 -- Name: user_blocks_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1775 ALTER TABLE ONLY user_blocks
1776 ADD CONSTRAINT user_blocks_pkey PRIMARY KEY (id);
1780 -- Name: user_preferences_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1783 ALTER TABLE ONLY user_preferences
1784 ADD CONSTRAINT user_preferences_pkey PRIMARY KEY (user_id, k);
1788 -- Name: user_roles_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1791 ALTER TABLE ONLY user_roles
1792 ADD CONSTRAINT user_roles_pkey PRIMARY KEY (id);
1796 -- Name: user_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1799 ALTER TABLE ONLY user_tokens
1800 ADD CONSTRAINT user_tokens_pkey PRIMARY KEY (id);
1804 -- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1807 ALTER TABLE ONLY users
1808 ADD CONSTRAINT users_pkey PRIMARY KEY (id);
1812 -- Name: way_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1815 ALTER TABLE ONLY way_nodes
1816 ADD CONSTRAINT way_nodes_pkey PRIMARY KEY (way_id, version, sequence_id);
1820 -- Name: way_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1823 ALTER TABLE ONLY way_tags
1824 ADD CONSTRAINT way_tags_pkey PRIMARY KEY (way_id, version, k);
1828 -- Name: ways_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1831 ALTER TABLE ONLY ways
1832 ADD CONSTRAINT ways_pkey PRIMARY KEY (way_id, version);
1836 -- Name: acls_k_idx; Type: INDEX; Schema: public; Owner: -
1839 CREATE INDEX acls_k_idx ON acls USING btree (k);
1843 -- Name: changeset_tags_id_idx; Type: INDEX; Schema: public; Owner: -
1846 CREATE INDEX changeset_tags_id_idx ON changeset_tags USING btree (changeset_id);
1850 -- Name: changesets_bbox_idx; Type: INDEX; Schema: public; Owner: -
1853 CREATE INDEX changesets_bbox_idx ON changesets USING gist (min_lat, max_lat, min_lon, max_lon);
1857 -- Name: changesets_closed_at_idx; Type: INDEX; Schema: public; Owner: -
1860 CREATE INDEX changesets_closed_at_idx ON changesets USING btree (closed_at);
1864 -- Name: changesets_created_at_idx; Type: INDEX; Schema: public; Owner: -
1867 CREATE INDEX changesets_created_at_idx ON changesets USING btree (created_at);
1871 -- Name: changesets_user_id_created_at_idx; Type: INDEX; Schema: public; Owner: -
1874 CREATE INDEX changesets_user_id_created_at_idx ON changesets USING btree (user_id, created_at);
1878 -- Name: changesets_user_id_id_idx; Type: INDEX; Schema: public; Owner: -
1881 CREATE INDEX changesets_user_id_id_idx ON changesets USING btree (user_id, id);
1885 -- Name: current_nodes_tile_idx; Type: INDEX; Schema: public; Owner: -
1888 CREATE INDEX current_nodes_tile_idx ON current_nodes USING btree (tile);
1892 -- Name: current_nodes_timestamp_idx; Type: INDEX; Schema: public; Owner: -
1895 CREATE INDEX current_nodes_timestamp_idx ON current_nodes USING btree ("timestamp");
1899 -- Name: current_relation_members_member_idx; Type: INDEX; Schema: public; Owner: -
1902 CREATE INDEX current_relation_members_member_idx ON current_relation_members USING btree (member_type, member_id);
1906 -- Name: current_relations_timestamp_idx; Type: INDEX; Schema: public; Owner: -
1909 CREATE INDEX current_relations_timestamp_idx ON current_relations USING btree ("timestamp");
1913 -- Name: current_way_nodes_node_idx; Type: INDEX; Schema: public; Owner: -
1916 CREATE INDEX current_way_nodes_node_idx ON current_way_nodes USING btree (node_id);
1920 -- Name: current_ways_timestamp_idx; Type: INDEX; Schema: public; Owner: -
1923 CREATE INDEX current_ways_timestamp_idx ON current_ways USING btree ("timestamp");
1927 -- Name: diary_comment_user_id_created_at_index; Type: INDEX; Schema: public; Owner: -
1930 CREATE INDEX diary_comment_user_id_created_at_index ON diary_comments USING btree (user_id, created_at);
1934 -- Name: diary_comments_entry_id_idx; Type: INDEX; Schema: public; Owner: -
1937 CREATE UNIQUE INDEX diary_comments_entry_id_idx ON diary_comments USING btree (diary_entry_id, id);
1941 -- Name: diary_entry_created_at_index; Type: INDEX; Schema: public; Owner: -
1944 CREATE INDEX diary_entry_created_at_index ON diary_entries USING btree (created_at);
1948 -- Name: diary_entry_language_code_created_at_index; Type: INDEX; Schema: public; Owner: -
1951 CREATE INDEX diary_entry_language_code_created_at_index ON diary_entries USING btree (language_code, created_at);
1955 -- Name: diary_entry_user_id_created_at_index; Type: INDEX; Schema: public; Owner: -
1958 CREATE INDEX diary_entry_user_id_created_at_index ON diary_entries USING btree (user_id, created_at);
1962 -- Name: friends_user_id_idx; Type: INDEX; Schema: public; Owner: -
1965 CREATE INDEX friends_user_id_idx ON friends USING btree (user_id);
1969 -- Name: gpx_file_tags_gpxid_idx; Type: INDEX; Schema: public; Owner: -
1972 CREATE INDEX gpx_file_tags_gpxid_idx ON gpx_file_tags USING btree (gpx_id);
1976 -- Name: gpx_file_tags_tag_idx; Type: INDEX; Schema: public; Owner: -
1979 CREATE INDEX gpx_file_tags_tag_idx ON gpx_file_tags USING btree (tag);
1983 -- Name: gpx_files_timestamp_idx; Type: INDEX; Schema: public; Owner: -
1986 CREATE INDEX gpx_files_timestamp_idx ON gpx_files USING btree ("timestamp");
1990 -- Name: gpx_files_user_id_idx; Type: INDEX; Schema: public; Owner: -
1993 CREATE INDEX gpx_files_user_id_idx ON gpx_files USING btree (user_id);
1997 -- Name: gpx_files_visible_visibility_idx; Type: INDEX; Schema: public; Owner: -
2000 CREATE INDEX gpx_files_visible_visibility_idx ON gpx_files USING btree (visible, visibility);
2004 -- Name: index_changeset_comments_on_created_at; Type: INDEX; Schema: public; Owner: -
2007 CREATE INDEX index_changeset_comments_on_created_at ON changeset_comments USING btree (created_at);
2011 -- Name: index_changesets_subscribers_on_changeset_id; Type: INDEX; Schema: public; Owner: -
2014 CREATE INDEX index_changesets_subscribers_on_changeset_id ON changesets_subscribers USING btree (changeset_id);
2018 -- Name: index_changesets_subscribers_on_subscriber_id_and_changeset_id; Type: INDEX; Schema: public; Owner: -
2021 CREATE UNIQUE INDEX index_changesets_subscribers_on_subscriber_id_and_changeset_id ON changesets_subscribers USING btree (subscriber_id, changeset_id);
2025 -- Name: index_client_applications_on_key; Type: INDEX; Schema: public; Owner: -
2028 CREATE UNIQUE INDEX index_client_applications_on_key ON client_applications USING btree (key);
2032 -- Name: index_client_applications_on_user_id; Type: INDEX; Schema: public; Owner: -
2035 CREATE INDEX index_client_applications_on_user_id ON client_applications USING btree (user_id);
2039 -- Name: index_diary_entry_subscriptions_on_diary_entry_id; Type: INDEX; Schema: public; Owner: -
2042 CREATE INDEX index_diary_entry_subscriptions_on_diary_entry_id ON diary_entry_subscriptions USING btree (diary_entry_id);
2046 -- Name: index_issue_comments_on_issue_id; Type: INDEX; Schema: public; Owner: -
2049 CREATE INDEX index_issue_comments_on_issue_id ON issue_comments USING btree (issue_id);
2053 -- Name: index_issue_comments_on_user_id; Type: INDEX; Schema: public; Owner: -
2056 CREATE INDEX index_issue_comments_on_user_id ON issue_comments USING btree (user_id);
2060 -- Name: index_issues_on_reportable_type_and_reportable_id; Type: INDEX; Schema: public; Owner: -
2063 CREATE INDEX index_issues_on_reportable_type_and_reportable_id ON issues USING btree (reportable_type, reportable_id);
2067 -- Name: index_issues_on_reported_user_id; Type: INDEX; Schema: public; Owner: -
2070 CREATE INDEX index_issues_on_reported_user_id ON issues USING btree (reported_user_id);
2074 -- Name: index_issues_on_updated_by; Type: INDEX; Schema: public; Owner: -
2077 CREATE INDEX index_issues_on_updated_by ON issues USING btree (updated_by);
2081 -- Name: index_note_comments_on_body; Type: INDEX; Schema: public; Owner: -
2084 CREATE INDEX index_note_comments_on_body ON note_comments USING gin (to_tsvector('english'::regconfig, body));
2088 -- Name: index_note_comments_on_created_at; Type: INDEX; Schema: public; Owner: -
2091 CREATE INDEX index_note_comments_on_created_at ON note_comments USING btree (created_at);
2095 -- Name: index_oauth_nonces_on_nonce_and_timestamp; Type: INDEX; Schema: public; Owner: -
2098 CREATE UNIQUE INDEX index_oauth_nonces_on_nonce_and_timestamp ON oauth_nonces USING btree (nonce, "timestamp");
2102 -- Name: index_oauth_tokens_on_token; Type: INDEX; Schema: public; Owner: -
2105 CREATE UNIQUE INDEX index_oauth_tokens_on_token ON oauth_tokens USING btree (token);
2109 -- Name: index_oauth_tokens_on_user_id; Type: INDEX; Schema: public; Owner: -
2112 CREATE INDEX index_oauth_tokens_on_user_id ON oauth_tokens USING btree (user_id);
2116 -- Name: index_reports_on_issue_id; Type: INDEX; Schema: public; Owner: -
2119 CREATE INDEX index_reports_on_issue_id ON reports USING btree (issue_id);
2123 -- Name: index_reports_on_user_id; Type: INDEX; Schema: public; Owner: -
2126 CREATE INDEX index_reports_on_user_id ON reports USING btree (user_id);
2130 -- Name: index_user_blocks_on_user_id; Type: INDEX; Schema: public; Owner: -
2133 CREATE INDEX index_user_blocks_on_user_id ON user_blocks USING btree (user_id);
2137 -- Name: messages_from_user_id_idx; Type: INDEX; Schema: public; Owner: -
2140 CREATE INDEX messages_from_user_id_idx ON messages USING btree (from_user_id);
2144 -- Name: messages_to_user_id_idx; Type: INDEX; Schema: public; Owner: -
2147 CREATE INDEX messages_to_user_id_idx ON messages USING btree (to_user_id);
2151 -- Name: nodes_changeset_id_idx; Type: INDEX; Schema: public; Owner: -
2154 CREATE INDEX nodes_changeset_id_idx ON nodes USING btree (changeset_id);
2158 -- Name: nodes_tile_idx; Type: INDEX; Schema: public; Owner: -
2161 CREATE INDEX nodes_tile_idx ON nodes USING btree (tile);
2165 -- Name: nodes_timestamp_idx; Type: INDEX; Schema: public; Owner: -
2168 CREATE INDEX nodes_timestamp_idx ON nodes USING btree ("timestamp");
2172 -- Name: note_comments_note_id_idx; Type: INDEX; Schema: public; Owner: -
2175 CREATE INDEX note_comments_note_id_idx ON note_comments USING btree (note_id);
2179 -- Name: notes_created_at_idx; Type: INDEX; Schema: public; Owner: -
2182 CREATE INDEX notes_created_at_idx ON notes USING btree (created_at);
2186 -- Name: notes_tile_status_idx; Type: INDEX; Schema: public; Owner: -
2189 CREATE INDEX notes_tile_status_idx ON notes USING btree (tile, status);
2193 -- Name: notes_updated_at_idx; Type: INDEX; Schema: public; Owner: -
2196 CREATE INDEX notes_updated_at_idx ON notes USING btree (updated_at);
2200 -- Name: points_gpxid_idx; Type: INDEX; Schema: public; Owner: -
2203 CREATE INDEX points_gpxid_idx ON gps_points USING btree (gpx_id);
2207 -- Name: points_tile_idx; Type: INDEX; Schema: public; Owner: -
2210 CREATE INDEX points_tile_idx ON gps_points USING btree (tile);
2214 -- Name: relation_members_member_idx; Type: INDEX; Schema: public; Owner: -
2217 CREATE INDEX relation_members_member_idx ON relation_members USING btree (member_type, member_id);
2221 -- Name: relations_changeset_id_idx; Type: INDEX; Schema: public; Owner: -
2224 CREATE INDEX relations_changeset_id_idx ON relations USING btree (changeset_id);
2228 -- Name: relations_timestamp_idx; Type: INDEX; Schema: public; Owner: -
2231 CREATE INDEX relations_timestamp_idx ON relations USING btree ("timestamp");
2235 -- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -
2238 CREATE UNIQUE INDEX unique_schema_migrations ON schema_migrations USING btree (version);
2242 -- Name: user_id_idx; Type: INDEX; Schema: public; Owner: -
2245 CREATE INDEX user_id_idx ON friends USING btree (friend_user_id);
2249 -- Name: user_roles_id_role_unique; Type: INDEX; Schema: public; Owner: -
2252 CREATE UNIQUE INDEX user_roles_id_role_unique ON user_roles USING btree (user_id, role);
2256 -- Name: user_tokens_token_idx; Type: INDEX; Schema: public; Owner: -
2259 CREATE UNIQUE INDEX user_tokens_token_idx ON user_tokens USING btree (token);
2263 -- Name: user_tokens_user_id_idx; Type: INDEX; Schema: public; Owner: -
2266 CREATE INDEX user_tokens_user_id_idx ON user_tokens USING btree (user_id);
2270 -- Name: users_auth_idx; Type: INDEX; Schema: public; Owner: -
2273 CREATE UNIQUE INDEX users_auth_idx ON users USING btree (auth_provider, auth_uid);
2277 -- Name: users_display_name_idx; Type: INDEX; Schema: public; Owner: -
2280 CREATE UNIQUE INDEX users_display_name_idx ON users USING btree (display_name);
2284 -- Name: users_display_name_lower_idx; Type: INDEX; Schema: public; Owner: -
2287 CREATE INDEX users_display_name_lower_idx ON users USING btree (lower((display_name)::text));
2291 -- Name: users_email_idx; Type: INDEX; Schema: public; Owner: -
2294 CREATE UNIQUE INDEX users_email_idx ON users USING btree (email);
2298 -- Name: users_email_lower_idx; Type: INDEX; Schema: public; Owner: -
2301 CREATE INDEX users_email_lower_idx ON users USING btree (lower((email)::text));
2305 -- Name: way_nodes_node_idx; Type: INDEX; Schema: public; Owner: -
2308 CREATE INDEX way_nodes_node_idx ON way_nodes USING btree (node_id);
2312 -- Name: ways_changeset_id_idx; Type: INDEX; Schema: public; Owner: -
2315 CREATE INDEX ways_changeset_id_idx ON ways USING btree (changeset_id);
2319 -- Name: ways_timestamp_idx; Type: INDEX; Schema: public; Owner: -
2322 CREATE INDEX ways_timestamp_idx ON ways USING btree ("timestamp");
2326 -- Name: changeset_comments_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2329 ALTER TABLE ONLY changeset_comments
2330 ADD CONSTRAINT changeset_comments_author_id_fkey FOREIGN KEY (author_id) REFERENCES users(id);
2334 -- Name: changeset_comments_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2337 ALTER TABLE ONLY changeset_comments
2338 ADD CONSTRAINT changeset_comments_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2342 -- Name: changeset_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2345 ALTER TABLE ONLY changeset_tags
2346 ADD CONSTRAINT changeset_tags_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2350 -- Name: changesets_subscribers_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2353 ALTER TABLE ONLY changesets_subscribers
2354 ADD CONSTRAINT changesets_subscribers_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2358 -- Name: changesets_subscribers_subscriber_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2361 ALTER TABLE ONLY changesets_subscribers
2362 ADD CONSTRAINT changesets_subscribers_subscriber_id_fkey FOREIGN KEY (subscriber_id) REFERENCES users(id);
2366 -- Name: changesets_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2369 ALTER TABLE ONLY changesets
2370 ADD CONSTRAINT changesets_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2374 -- Name: client_applications_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2377 ALTER TABLE ONLY client_applications
2378 ADD CONSTRAINT client_applications_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2382 -- Name: current_node_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2385 ALTER TABLE ONLY current_node_tags
2386 ADD CONSTRAINT current_node_tags_id_fkey FOREIGN KEY (node_id) REFERENCES current_nodes(id);
2390 -- Name: current_nodes_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2393 ALTER TABLE ONLY current_nodes
2394 ADD CONSTRAINT current_nodes_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2398 -- Name: current_relation_members_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2401 ALTER TABLE ONLY current_relation_members
2402 ADD CONSTRAINT current_relation_members_id_fkey FOREIGN KEY (relation_id) REFERENCES current_relations(id);
2406 -- Name: current_relation_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2409 ALTER TABLE ONLY current_relation_tags
2410 ADD CONSTRAINT current_relation_tags_id_fkey FOREIGN KEY (relation_id) REFERENCES current_relations(id);
2414 -- Name: current_relations_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2417 ALTER TABLE ONLY current_relations
2418 ADD CONSTRAINT current_relations_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2422 -- Name: current_way_nodes_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2425 ALTER TABLE ONLY current_way_nodes
2426 ADD CONSTRAINT current_way_nodes_id_fkey FOREIGN KEY (way_id) REFERENCES current_ways(id);
2430 -- Name: current_way_nodes_node_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2433 ALTER TABLE ONLY current_way_nodes
2434 ADD CONSTRAINT current_way_nodes_node_id_fkey FOREIGN KEY (node_id) REFERENCES current_nodes(id);
2438 -- Name: current_way_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2441 ALTER TABLE ONLY current_way_tags
2442 ADD CONSTRAINT current_way_tags_id_fkey FOREIGN KEY (way_id) REFERENCES current_ways(id);
2446 -- Name: current_ways_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2449 ALTER TABLE ONLY current_ways
2450 ADD CONSTRAINT current_ways_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2454 -- Name: diary_comments_diary_entry_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2457 ALTER TABLE ONLY diary_comments
2458 ADD CONSTRAINT diary_comments_diary_entry_id_fkey FOREIGN KEY (diary_entry_id) REFERENCES diary_entries(id);
2462 -- Name: diary_comments_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2465 ALTER TABLE ONLY diary_comments
2466 ADD CONSTRAINT diary_comments_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2470 -- Name: diary_entries_language_code_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2473 ALTER TABLE ONLY diary_entries
2474 ADD CONSTRAINT diary_entries_language_code_fkey FOREIGN KEY (language_code) REFERENCES languages(code);
2478 -- Name: diary_entries_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2481 ALTER TABLE ONLY diary_entries
2482 ADD CONSTRAINT diary_entries_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2486 -- Name: diary_entry_subscriptions_diary_entry_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2489 ALTER TABLE ONLY diary_entry_subscriptions
2490 ADD CONSTRAINT diary_entry_subscriptions_diary_entry_id_fkey FOREIGN KEY (diary_entry_id) REFERENCES diary_entries(id);
2494 -- Name: diary_entry_subscriptions_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2497 ALTER TABLE ONLY diary_entry_subscriptions
2498 ADD CONSTRAINT diary_entry_subscriptions_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2502 -- Name: friends_friend_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2505 ALTER TABLE ONLY friends
2506 ADD CONSTRAINT friends_friend_user_id_fkey FOREIGN KEY (friend_user_id) REFERENCES users(id);
2510 -- Name: friends_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2513 ALTER TABLE ONLY friends
2514 ADD CONSTRAINT friends_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2518 -- Name: gps_points_gpx_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2521 ALTER TABLE ONLY gps_points
2522 ADD CONSTRAINT gps_points_gpx_id_fkey FOREIGN KEY (gpx_id) REFERENCES gpx_files(id);
2526 -- Name: gpx_file_tags_gpx_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2529 ALTER TABLE ONLY gpx_file_tags
2530 ADD CONSTRAINT gpx_file_tags_gpx_id_fkey FOREIGN KEY (gpx_id) REFERENCES gpx_files(id);
2534 -- Name: gpx_files_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2537 ALTER TABLE ONLY gpx_files
2538 ADD CONSTRAINT gpx_files_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2542 -- Name: issue_comments_issue_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2545 ALTER TABLE ONLY issue_comments
2546 ADD CONSTRAINT issue_comments_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES issues(id);
2550 -- Name: issue_comments_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2553 ALTER TABLE ONLY issue_comments
2554 ADD CONSTRAINT issue_comments_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2558 -- Name: issues_reported_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2561 ALTER TABLE ONLY issues
2562 ADD CONSTRAINT issues_reported_user_id_fkey FOREIGN KEY (reported_user_id) REFERENCES users(id);
2566 -- Name: issues_resolved_by_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2569 ALTER TABLE ONLY issues
2570 ADD CONSTRAINT issues_resolved_by_fkey FOREIGN KEY (resolved_by) REFERENCES users(id);
2574 -- Name: issues_updated_by_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2577 ALTER TABLE ONLY issues
2578 ADD CONSTRAINT issues_updated_by_fkey FOREIGN KEY (updated_by) REFERENCES users(id);
2582 -- Name: messages_from_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2585 ALTER TABLE ONLY messages
2586 ADD CONSTRAINT messages_from_user_id_fkey FOREIGN KEY (from_user_id) REFERENCES users(id);
2590 -- Name: messages_to_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2593 ALTER TABLE ONLY messages
2594 ADD CONSTRAINT messages_to_user_id_fkey FOREIGN KEY (to_user_id) REFERENCES users(id);
2598 -- Name: node_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2601 ALTER TABLE ONLY node_tags
2602 ADD CONSTRAINT node_tags_id_fkey FOREIGN KEY (node_id, version) REFERENCES nodes(node_id, version);
2606 -- Name: nodes_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2609 ALTER TABLE ONLY nodes
2610 ADD CONSTRAINT nodes_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2614 -- Name: nodes_redaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2617 ALTER TABLE ONLY nodes
2618 ADD CONSTRAINT nodes_redaction_id_fkey FOREIGN KEY (redaction_id) REFERENCES redactions(id);
2622 -- Name: note_comments_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2625 ALTER TABLE ONLY note_comments
2626 ADD CONSTRAINT note_comments_author_id_fkey FOREIGN KEY (author_id) REFERENCES users(id);
2630 -- Name: note_comments_note_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2633 ALTER TABLE ONLY note_comments
2634 ADD CONSTRAINT note_comments_note_id_fkey FOREIGN KEY (note_id) REFERENCES notes(id);
2638 -- Name: oauth_tokens_client_application_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2641 ALTER TABLE ONLY oauth_tokens
2642 ADD CONSTRAINT oauth_tokens_client_application_id_fkey FOREIGN KEY (client_application_id) REFERENCES client_applications(id);
2646 -- Name: oauth_tokens_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2649 ALTER TABLE ONLY oauth_tokens
2650 ADD CONSTRAINT oauth_tokens_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2654 -- Name: redactions_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2657 ALTER TABLE ONLY redactions
2658 ADD CONSTRAINT redactions_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2662 -- Name: relation_members_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2665 ALTER TABLE ONLY relation_members
2666 ADD CONSTRAINT relation_members_id_fkey FOREIGN KEY (relation_id, version) REFERENCES relations(relation_id, version);
2670 -- Name: relation_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2673 ALTER TABLE ONLY relation_tags
2674 ADD CONSTRAINT relation_tags_id_fkey FOREIGN KEY (relation_id, version) REFERENCES relations(relation_id, version);
2678 -- Name: relations_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2681 ALTER TABLE ONLY relations
2682 ADD CONSTRAINT relations_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2686 -- Name: relations_redaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2689 ALTER TABLE ONLY relations
2690 ADD CONSTRAINT relations_redaction_id_fkey FOREIGN KEY (redaction_id) REFERENCES redactions(id);
2694 -- Name: reports_issue_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2697 ALTER TABLE ONLY reports
2698 ADD CONSTRAINT reports_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES issues(id);
2702 -- Name: reports_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2705 ALTER TABLE ONLY reports
2706 ADD CONSTRAINT reports_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2710 -- Name: user_blocks_moderator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2713 ALTER TABLE ONLY user_blocks
2714 ADD CONSTRAINT user_blocks_moderator_id_fkey FOREIGN KEY (creator_id) REFERENCES users(id);
2718 -- Name: user_blocks_revoker_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2721 ALTER TABLE ONLY user_blocks
2722 ADD CONSTRAINT user_blocks_revoker_id_fkey FOREIGN KEY (revoker_id) REFERENCES users(id);
2726 -- Name: user_blocks_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2729 ALTER TABLE ONLY user_blocks
2730 ADD CONSTRAINT user_blocks_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2734 -- Name: user_preferences_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2737 ALTER TABLE ONLY user_preferences
2738 ADD CONSTRAINT user_preferences_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2742 -- Name: user_roles_granter_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2745 ALTER TABLE ONLY user_roles
2746 ADD CONSTRAINT user_roles_granter_id_fkey FOREIGN KEY (granter_id) REFERENCES users(id);
2750 -- Name: user_roles_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2753 ALTER TABLE ONLY user_roles
2754 ADD CONSTRAINT user_roles_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2758 -- Name: user_tokens_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2761 ALTER TABLE ONLY user_tokens
2762 ADD CONSTRAINT user_tokens_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2766 -- Name: way_nodes_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2769 ALTER TABLE ONLY way_nodes
2770 ADD CONSTRAINT way_nodes_id_fkey FOREIGN KEY (way_id, version) REFERENCES ways(way_id, version);
2774 -- Name: way_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2777 ALTER TABLE ONLY way_tags
2778 ADD CONSTRAINT way_tags_id_fkey FOREIGN KEY (way_id, version) REFERENCES ways(way_id, version);
2782 -- Name: ways_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2785 ALTER TABLE ONLY ways
2786 ADD CONSTRAINT ways_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2790 -- Name: ways_redaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2793 ALTER TABLE ONLY ways
2794 ADD CONSTRAINT ways_redaction_id_fkey FOREIGN KEY (redaction_id) REFERENCES redactions(id);
2798 -- PostgreSQL database dump complete
2801 SET search_path TO "$user", public;
2803 INSERT INTO "schema_migrations" (version) VALUES