2 -- PostgreSQL database dump
5 -- Dumped from database version 9.5.3
6 -- Dumped by pg_dump version 9.5.3
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: note_event_enum; Type: TYPE; Schema: public; Owner: -
73 CREATE TYPE note_event_enum AS ENUM (
83 -- Name: note_status_enum; Type: TYPE; Schema: public; Owner: -
86 CREATE TYPE note_status_enum AS ENUM (
94 -- Name: nwr_enum; Type: TYPE; Schema: public; Owner: -
97 CREATE TYPE nwr_enum AS ENUM (
105 -- Name: user_role_enum; Type: TYPE; Schema: public; Owner: -
108 CREATE TYPE user_role_enum AS ENUM (
115 -- Name: user_status_enum; Type: TYPE; Schema: public; Owner: -
118 CREATE TYPE user_status_enum AS ENUM (
128 -- Name: maptile_for_point(bigint, bigint, integer); Type: FUNCTION; Schema: public; Owner: -
131 CREATE FUNCTION maptile_for_point(bigint, bigint, integer) RETURNS integer
133 AS '$libdir/libpgosm', 'maptile_for_point';
137 -- Name: tile_for_point(integer, integer); Type: FUNCTION; Schema: public; Owner: -
140 CREATE FUNCTION tile_for_point(integer, integer) RETURNS bigint
142 AS '$libdir/libpgosm', 'tile_for_point';
146 -- Name: xid_to_int4(xid); Type: FUNCTION; Schema: public; Owner: -
149 CREATE FUNCTION xid_to_int4(xid) RETURNS integer
150 LANGUAGE c IMMUTABLE STRICT
151 AS '$libdir/libpgosm', 'xid_to_int4';
154 SET default_tablespace = '';
156 SET default_with_oids = false;
159 -- Name: acls; Type: TABLE; Schema: public; Owner: -
165 k character varying(255) NOT NULL,
166 v character varying(255),
167 domain character varying(255)
172 -- Name: acls_id_seq; Type: SEQUENCE; Schema: public; Owner: -
175 CREATE SEQUENCE acls_id_seq
184 -- Name: acls_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
187 ALTER SEQUENCE acls_id_seq OWNED BY acls.id;
191 -- Name: changeset_comments; Type: TABLE; Schema: public; Owner: -
194 CREATE TABLE changeset_comments (
196 changeset_id bigint NOT NULL,
197 author_id bigint NOT NULL,
199 created_at timestamp without time zone NOT NULL,
200 visible boolean NOT NULL
205 -- Name: changeset_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
208 CREATE SEQUENCE changeset_comments_id_seq
217 -- Name: changeset_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
220 ALTER SEQUENCE changeset_comments_id_seq OWNED BY changeset_comments.id;
224 -- Name: changeset_tags; Type: TABLE; Schema: public; Owner: -
227 CREATE TABLE changeset_tags (
228 changeset_id bigint NOT NULL,
229 k character varying(255) DEFAULT ''::character varying NOT NULL,
230 v character varying(255) DEFAULT ''::character varying NOT NULL
235 -- Name: changesets; Type: TABLE; Schema: public; Owner: -
238 CREATE TABLE changesets (
240 user_id bigint NOT NULL,
241 created_at timestamp without time zone NOT NULL,
246 closed_at timestamp without time zone NOT NULL,
247 num_changes integer DEFAULT 0 NOT NULL
252 -- Name: changesets_id_seq; Type: SEQUENCE; Schema: public; Owner: -
255 CREATE SEQUENCE changesets_id_seq
264 -- Name: changesets_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
267 ALTER SEQUENCE changesets_id_seq OWNED BY changesets.id;
271 -- Name: changesets_subscribers; Type: TABLE; Schema: public; Owner: -
274 CREATE TABLE changesets_subscribers (
275 subscriber_id bigint NOT NULL,
276 changeset_id bigint NOT NULL
281 -- Name: client_applications; Type: TABLE; Schema: public; Owner: -
284 CREATE TABLE client_applications (
286 name character varying(255),
287 url character varying(255),
288 support_url character varying(255),
289 callback_url character varying(255),
290 key character varying(50),
291 secret character varying(50),
293 created_at timestamp without time zone,
294 updated_at timestamp without time zone,
295 allow_read_prefs boolean DEFAULT false NOT NULL,
296 allow_write_prefs boolean DEFAULT false NOT NULL,
297 allow_write_diary boolean DEFAULT false NOT NULL,
298 allow_write_api boolean DEFAULT false NOT NULL,
299 allow_read_gpx boolean DEFAULT false NOT NULL,
300 allow_write_gpx boolean DEFAULT false NOT NULL,
301 allow_write_notes boolean DEFAULT false NOT NULL
306 -- Name: client_applications_id_seq; Type: SEQUENCE; Schema: public; Owner: -
309 CREATE SEQUENCE client_applications_id_seq
318 -- Name: client_applications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
321 ALTER SEQUENCE client_applications_id_seq OWNED BY client_applications.id;
325 -- Name: current_node_tags; Type: TABLE; Schema: public; Owner: -
328 CREATE TABLE current_node_tags (
329 node_id bigint NOT NULL,
330 k character varying(255) DEFAULT ''::character varying NOT NULL,
331 v character varying(255) DEFAULT ''::character varying NOT NULL
336 -- Name: current_nodes; Type: TABLE; Schema: public; Owner: -
339 CREATE TABLE current_nodes (
341 latitude integer NOT NULL,
342 longitude integer NOT NULL,
343 changeset_id bigint NOT NULL,
344 visible boolean NOT NULL,
345 "timestamp" timestamp without time zone NOT NULL,
346 tile bigint NOT NULL,
347 version bigint NOT NULL
352 -- Name: current_nodes_id_seq; Type: SEQUENCE; Schema: public; Owner: -
355 CREATE SEQUENCE current_nodes_id_seq
364 -- Name: current_nodes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
367 ALTER SEQUENCE current_nodes_id_seq OWNED BY current_nodes.id;
371 -- Name: current_relation_members; Type: TABLE; Schema: public; Owner: -
374 CREATE TABLE current_relation_members (
375 relation_id bigint NOT NULL,
376 member_type nwr_enum NOT NULL,
377 member_id bigint NOT NULL,
378 member_role character varying(255) NOT NULL,
379 sequence_id integer DEFAULT 0 NOT NULL
384 -- Name: current_relation_tags; Type: TABLE; Schema: public; Owner: -
387 CREATE TABLE current_relation_tags (
388 relation_id bigint NOT NULL,
389 k character varying(255) DEFAULT ''::character varying NOT NULL,
390 v character varying(255) DEFAULT ''::character varying NOT NULL
395 -- Name: current_relations; Type: TABLE; Schema: public; Owner: -
398 CREATE TABLE current_relations (
400 changeset_id bigint NOT NULL,
401 "timestamp" timestamp without time zone NOT NULL,
402 visible boolean NOT NULL,
403 version bigint NOT NULL
408 -- Name: current_relations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
411 CREATE SEQUENCE current_relations_id_seq
420 -- Name: current_relations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
423 ALTER SEQUENCE current_relations_id_seq OWNED BY current_relations.id;
427 -- Name: current_way_nodes; Type: TABLE; Schema: public; Owner: -
430 CREATE TABLE current_way_nodes (
431 way_id bigint NOT NULL,
432 node_id bigint NOT NULL,
433 sequence_id bigint NOT NULL
438 -- Name: current_way_tags; Type: TABLE; Schema: public; Owner: -
441 CREATE TABLE current_way_tags (
442 way_id bigint NOT NULL,
443 k character varying(255) DEFAULT ''::character varying NOT NULL,
444 v character varying(255) DEFAULT ''::character varying NOT NULL
449 -- Name: current_ways; Type: TABLE; Schema: public; Owner: -
452 CREATE TABLE current_ways (
454 changeset_id bigint NOT NULL,
455 "timestamp" timestamp without time zone NOT NULL,
456 visible boolean NOT NULL,
457 version bigint NOT NULL
462 -- Name: current_ways_id_seq; Type: SEQUENCE; Schema: public; Owner: -
465 CREATE SEQUENCE current_ways_id_seq
474 -- Name: current_ways_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
477 ALTER SEQUENCE current_ways_id_seq OWNED BY current_ways.id;
481 -- Name: diary_comments; Type: TABLE; Schema: public; Owner: -
484 CREATE TABLE diary_comments (
486 diary_entry_id bigint NOT NULL,
487 user_id bigint NOT NULL,
489 created_at timestamp without time zone NOT NULL,
490 updated_at timestamp without time zone NOT NULL,
491 visible boolean DEFAULT true NOT NULL,
492 body_format format_enum DEFAULT 'markdown'::format_enum NOT NULL
497 -- Name: diary_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
500 CREATE SEQUENCE diary_comments_id_seq
509 -- Name: diary_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
512 ALTER SEQUENCE diary_comments_id_seq OWNED BY diary_comments.id;
516 -- Name: diary_entries; Type: TABLE; Schema: public; Owner: -
519 CREATE TABLE diary_entries (
521 user_id bigint NOT NULL,
522 title character varying(255) NOT NULL,
524 created_at timestamp without time zone NOT NULL,
525 updated_at timestamp without time zone NOT NULL,
526 latitude double precision,
527 longitude double precision,
528 language_code character varying(255) DEFAULT 'en'::character varying NOT NULL,
529 visible boolean DEFAULT true NOT NULL,
530 body_format format_enum DEFAULT 'markdown'::format_enum NOT NULL
535 -- Name: diary_entries_id_seq; Type: SEQUENCE; Schema: public; Owner: -
538 CREATE SEQUENCE diary_entries_id_seq
547 -- Name: diary_entries_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
550 ALTER SEQUENCE diary_entries_id_seq OWNED BY diary_entries.id;
554 -- Name: friends; Type: TABLE; Schema: public; Owner: -
557 CREATE TABLE friends (
559 user_id bigint NOT NULL,
560 friend_user_id bigint NOT NULL
565 -- Name: friends_id_seq; Type: SEQUENCE; Schema: public; Owner: -
568 CREATE SEQUENCE friends_id_seq
577 -- Name: friends_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
580 ALTER SEQUENCE friends_id_seq OWNED BY friends.id;
584 -- Name: gps_points; Type: TABLE; Schema: public; Owner: -
587 CREATE TABLE gps_points (
588 altitude double precision,
589 trackid integer NOT NULL,
590 latitude integer NOT NULL,
591 longitude integer NOT NULL,
592 gpx_id bigint NOT NULL,
593 "timestamp" timestamp without time zone,
599 -- Name: gpx_file_tags; Type: TABLE; Schema: public; Owner: -
602 CREATE TABLE gpx_file_tags (
603 gpx_id bigint DEFAULT 0 NOT NULL,
604 tag character varying(255) NOT NULL,
610 -- Name: gpx_file_tags_id_seq; Type: SEQUENCE; Schema: public; Owner: -
613 CREATE SEQUENCE gpx_file_tags_id_seq
622 -- Name: gpx_file_tags_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
625 ALTER SEQUENCE gpx_file_tags_id_seq OWNED BY gpx_file_tags.id;
629 -- Name: gpx_files; Type: TABLE; Schema: public; Owner: -
632 CREATE TABLE gpx_files (
634 user_id bigint NOT NULL,
635 visible boolean DEFAULT true NOT NULL,
636 name character varying(255) DEFAULT ''::character varying NOT NULL,
638 latitude double precision,
639 longitude double precision,
640 "timestamp" timestamp without time zone NOT NULL,
641 description character varying(255) DEFAULT ''::character varying NOT NULL,
642 inserted boolean NOT NULL,
643 visibility gpx_visibility_enum DEFAULT 'public'::gpx_visibility_enum NOT NULL
648 -- Name: gpx_files_id_seq; Type: SEQUENCE; Schema: public; Owner: -
651 CREATE SEQUENCE gpx_files_id_seq
660 -- Name: gpx_files_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
663 ALTER SEQUENCE gpx_files_id_seq OWNED BY gpx_files.id;
667 -- Name: issue_comments; Type: TABLE; Schema: public; Owner: -; Tablespace:
670 CREATE TABLE issue_comments (
673 commenter_user_id integer,
675 created_at timestamp without time zone NOT NULL,
677 updated_at timestamp without time zone NOT NULL
682 -- Name: issue_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
685 CREATE SEQUENCE issue_comments_id_seq
694 -- Name: issue_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
697 ALTER SEQUENCE issue_comments_id_seq OWNED BY issue_comments.id;
701 -- Name: issues; Type: TABLE; Schema: public; Owner: -; Tablespace:
704 CREATE TABLE issues (
706 reportable_type character varying NOT NULL,
707 reportable_id integer NOT NULL,
708 reported_user_id integer NOT NULL,
710 issue_type character varying,
711 resolved_at timestamp without time zone,
713 created_at timestamp without time zone NOT NULL,
714 updated_at timestamp without time zone NOT NULL,
716 report_count integer DEFAULT 0
721 -- Name: issues_id_seq; Type: SEQUENCE; Schema: public; Owner: -
724 CREATE SEQUENCE issues_id_seq
733 -- Name: issues_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
736 ALTER SEQUENCE issues_id_seq OWNED BY issues.id;
740 -- Name: languages; Type: TABLE; Schema: public; Owner: -
743 CREATE TABLE languages (
744 code character varying(255) NOT NULL,
745 english_name character varying(255) NOT NULL,
746 native_name character varying(255)
751 -- Name: messages; Type: TABLE; Schema: public; Owner: -
754 CREATE TABLE messages (
756 from_user_id bigint NOT NULL,
757 title character varying(255) NOT NULL,
759 sent_on timestamp without time zone NOT NULL,
760 message_read boolean DEFAULT false NOT NULL,
761 to_user_id bigint NOT NULL,
762 to_user_visible boolean DEFAULT true NOT NULL,
763 from_user_visible boolean DEFAULT true NOT NULL,
764 body_format format_enum DEFAULT 'markdown'::format_enum NOT NULL
769 -- Name: messages_id_seq; Type: SEQUENCE; Schema: public; Owner: -
772 CREATE SEQUENCE messages_id_seq
781 -- Name: messages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
784 ALTER SEQUENCE messages_id_seq OWNED BY messages.id;
788 -- Name: node_tags; Type: TABLE; Schema: public; Owner: -
791 CREATE TABLE node_tags (
792 node_id bigint NOT NULL,
793 version bigint NOT NULL,
794 k character varying(255) DEFAULT ''::character varying NOT NULL,
795 v character varying(255) DEFAULT ''::character varying NOT NULL
800 -- Name: nodes; Type: TABLE; Schema: public; Owner: -
804 node_id bigint NOT NULL,
805 latitude integer NOT NULL,
806 longitude integer NOT NULL,
807 changeset_id bigint NOT NULL,
808 visible boolean NOT NULL,
809 "timestamp" timestamp without time zone NOT NULL,
810 tile bigint NOT NULL,
811 version bigint NOT NULL,
817 -- Name: note_comments; Type: TABLE; Schema: public; Owner: -
820 CREATE TABLE note_comments (
822 note_id bigint NOT NULL,
823 visible boolean NOT NULL,
824 created_at timestamp without time zone NOT NULL,
828 event note_event_enum
833 -- Name: note_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
836 CREATE SEQUENCE note_comments_id_seq
845 -- Name: note_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
848 ALTER SEQUENCE note_comments_id_seq OWNED BY note_comments.id;
852 -- Name: notes; Type: TABLE; Schema: public; Owner: -
857 latitude integer NOT NULL,
858 longitude integer NOT NULL,
859 tile bigint NOT NULL,
860 updated_at timestamp without time zone NOT NULL,
861 created_at timestamp without time zone NOT NULL,
862 status note_status_enum NOT NULL,
863 closed_at timestamp without time zone
868 -- Name: notes_id_seq; Type: SEQUENCE; Schema: public; Owner: -
871 CREATE SEQUENCE notes_id_seq
880 -- Name: notes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
883 ALTER SEQUENCE notes_id_seq OWNED BY notes.id;
887 -- Name: oauth_nonces; Type: TABLE; Schema: public; Owner: -
890 CREATE TABLE oauth_nonces (
892 nonce character varying(255),
894 created_at timestamp without time zone,
895 updated_at timestamp without time zone
900 -- Name: oauth_nonces_id_seq; Type: SEQUENCE; Schema: public; Owner: -
903 CREATE SEQUENCE oauth_nonces_id_seq
912 -- Name: oauth_nonces_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
915 ALTER SEQUENCE oauth_nonces_id_seq OWNED BY oauth_nonces.id;
919 -- Name: oauth_tokens; Type: TABLE; Schema: public; Owner: -
922 CREATE TABLE oauth_tokens (
925 type character varying(20),
926 client_application_id integer,
927 token character varying(50),
928 secret character varying(50),
929 authorized_at timestamp without time zone,
930 invalidated_at timestamp without time zone,
931 created_at timestamp without time zone,
932 updated_at timestamp without time zone,
933 allow_read_prefs boolean DEFAULT false NOT NULL,
934 allow_write_prefs boolean DEFAULT false NOT NULL,
935 allow_write_diary boolean DEFAULT false NOT NULL,
936 allow_write_api boolean DEFAULT false NOT NULL,
937 allow_read_gpx boolean DEFAULT false NOT NULL,
938 allow_write_gpx boolean DEFAULT false NOT NULL,
939 callback_url character varying(255),
940 verifier character varying(20),
941 scope character varying(255),
942 valid_to timestamp without time zone,
943 allow_write_notes boolean DEFAULT false NOT NULL
948 -- Name: oauth_tokens_id_seq; Type: SEQUENCE; Schema: public; Owner: -
951 CREATE SEQUENCE oauth_tokens_id_seq
960 -- Name: oauth_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
963 ALTER SEQUENCE oauth_tokens_id_seq OWNED BY oauth_tokens.id;
967 -- Name: redactions; Type: TABLE; Schema: public; Owner: -
970 CREATE TABLE redactions (
972 title character varying(255),
974 created_at timestamp without time zone NOT NULL,
975 updated_at timestamp without time zone NOT NULL,
976 user_id bigint NOT NULL,
977 description_format format_enum DEFAULT 'markdown'::format_enum NOT NULL
982 -- Name: redactions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
985 CREATE SEQUENCE redactions_id_seq
994 -- Name: redactions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
997 ALTER SEQUENCE redactions_id_seq OWNED BY redactions.id;
1001 -- Name: relation_members; Type: TABLE; Schema: public; Owner: -
1004 CREATE TABLE relation_members (
1005 relation_id bigint DEFAULT 0 NOT NULL,
1006 member_type nwr_enum NOT NULL,
1007 member_id bigint NOT NULL,
1008 member_role character varying(255) NOT NULL,
1009 version bigint DEFAULT 0 NOT NULL,
1010 sequence_id integer DEFAULT 0 NOT NULL
1015 -- Name: relation_tags; Type: TABLE; Schema: public; Owner: -
1018 CREATE TABLE relation_tags (
1019 relation_id bigint DEFAULT 0 NOT NULL,
1020 k character varying(255) DEFAULT ''::character varying NOT NULL,
1021 v character varying(255) DEFAULT ''::character varying NOT NULL,
1022 version bigint NOT NULL
1027 -- Name: relations; Type: TABLE; Schema: public; Owner: -
1030 CREATE TABLE relations (
1031 relation_id bigint DEFAULT 0 NOT NULL,
1032 changeset_id bigint NOT NULL,
1033 "timestamp" timestamp without time zone NOT NULL,
1034 version bigint NOT NULL,
1035 visible boolean DEFAULT true NOT NULL,
1036 redaction_id integer
1041 -- Name: reports; Type: TABLE; Schema: public; Owner: -; Tablespace:
1044 CREATE TABLE reports (
1045 id integer NOT NULL,
1047 reporter_user_id integer,
1049 created_at timestamp without time zone NOT NULL,
1050 updated_at timestamp without time zone NOT NULL
1055 -- Name: reports_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1058 CREATE SEQUENCE reports_id_seq
1067 -- Name: reports_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1070 ALTER SEQUENCE reports_id_seq OWNED BY reports.id;
1074 -- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -
1077 CREATE TABLE schema_migrations (
1078 version character varying(255) NOT NULL
1083 -- Name: user_blocks; Type: TABLE; Schema: public; Owner: -
1086 CREATE TABLE user_blocks (
1087 id integer NOT NULL,
1088 user_id bigint NOT NULL,
1089 creator_id bigint NOT NULL,
1090 reason text NOT NULL,
1091 ends_at timestamp without time zone NOT NULL,
1092 needs_view boolean DEFAULT false NOT NULL,
1094 created_at timestamp without time zone,
1095 updated_at timestamp without time zone,
1096 reason_format format_enum DEFAULT 'markdown'::format_enum NOT NULL
1101 -- Name: user_blocks_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1104 CREATE SEQUENCE user_blocks_id_seq
1113 -- Name: user_blocks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1116 ALTER SEQUENCE user_blocks_id_seq OWNED BY user_blocks.id;
1120 -- Name: user_preferences; Type: TABLE; Schema: public; Owner: -
1123 CREATE TABLE user_preferences (
1124 user_id bigint NOT NULL,
1125 k character varying(255) NOT NULL,
1126 v character varying(255) NOT NULL
1131 -- Name: user_roles; Type: TABLE; Schema: public; Owner: -
1134 CREATE TABLE user_roles (
1135 id integer NOT NULL,
1136 user_id bigint NOT NULL,
1137 created_at timestamp without time zone,
1138 updated_at timestamp without time zone,
1139 role user_role_enum NOT NULL,
1140 granter_id bigint NOT NULL
1145 -- Name: user_roles_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1148 CREATE SEQUENCE user_roles_id_seq
1157 -- Name: user_roles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1160 ALTER SEQUENCE user_roles_id_seq OWNED BY user_roles.id;
1164 -- Name: user_tokens; Type: TABLE; Schema: public; Owner: -
1167 CREATE TABLE user_tokens (
1169 user_id bigint NOT NULL,
1170 token character varying(255) NOT NULL,
1171 expiry timestamp without time zone NOT NULL,
1177 -- Name: user_tokens_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1180 CREATE SEQUENCE user_tokens_id_seq
1189 -- Name: user_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1192 ALTER SEQUENCE user_tokens_id_seq OWNED BY user_tokens.id;
1196 -- Name: users; Type: TABLE; Schema: public; Owner: -
1199 CREATE TABLE users (
1200 email character varying(255) NOT NULL,
1202 pass_crypt character varying(255) NOT NULL,
1203 creation_time timestamp without time zone NOT NULL,
1204 display_name character varying(255) DEFAULT ''::character varying NOT NULL,
1205 data_public boolean DEFAULT false NOT NULL,
1206 description text DEFAULT ''::text NOT NULL,
1207 home_lat double precision,
1208 home_lon double precision,
1209 home_zoom smallint DEFAULT 3,
1210 nearby integer DEFAULT 50,
1211 pass_salt character varying(255),
1212 image_file_name text,
1213 email_valid boolean DEFAULT false NOT NULL,
1214 new_email character varying(255),
1215 creation_ip character varying(255),
1216 languages character varying(255),
1217 status user_status_enum DEFAULT 'pending'::user_status_enum NOT NULL,
1218 terms_agreed timestamp without time zone,
1219 consider_pd boolean DEFAULT false NOT NULL,
1220 preferred_editor character varying(255),
1221 terms_seen boolean DEFAULT false NOT NULL,
1222 auth_uid character varying(255),
1223 description_format format_enum DEFAULT 'markdown'::format_enum NOT NULL,
1224 image_fingerprint character varying(255),
1225 changesets_count integer DEFAULT 0 NOT NULL,
1226 traces_count integer DEFAULT 0 NOT NULL,
1227 diary_entries_count integer DEFAULT 0 NOT NULL,
1228 image_use_gravatar boolean DEFAULT false NOT NULL,
1229 image_content_type character varying(255),
1230 auth_provider character varying
1235 -- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1238 CREATE SEQUENCE users_id_seq
1247 -- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1250 ALTER SEQUENCE users_id_seq OWNED BY users.id;
1254 -- Name: way_nodes; Type: TABLE; Schema: public; Owner: -
1257 CREATE TABLE way_nodes (
1258 way_id bigint NOT NULL,
1259 node_id bigint NOT NULL,
1260 version bigint NOT NULL,
1261 sequence_id bigint NOT NULL
1266 -- Name: way_tags; Type: TABLE; Schema: public; Owner: -
1269 CREATE TABLE way_tags (
1270 way_id bigint DEFAULT 0 NOT NULL,
1271 k character varying(255) NOT NULL,
1272 v character varying(255) NOT NULL,
1273 version bigint NOT NULL
1278 -- Name: ways; Type: TABLE; Schema: public; Owner: -
1282 way_id bigint DEFAULT 0 NOT NULL,
1283 changeset_id bigint NOT NULL,
1284 "timestamp" timestamp without time zone NOT NULL,
1285 version bigint NOT NULL,
1286 visible boolean DEFAULT true NOT NULL,
1287 redaction_id integer
1292 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1295 ALTER TABLE ONLY acls ALTER COLUMN id SET DEFAULT nextval('acls_id_seq'::regclass);
1299 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1302 ALTER TABLE ONLY changeset_comments ALTER COLUMN id SET DEFAULT nextval('changeset_comments_id_seq'::regclass);
1306 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1309 ALTER TABLE ONLY changesets ALTER COLUMN id SET DEFAULT nextval('changesets_id_seq'::regclass);
1313 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1316 ALTER TABLE ONLY client_applications ALTER COLUMN id SET DEFAULT nextval('client_applications_id_seq'::regclass);
1320 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1323 ALTER TABLE ONLY current_nodes ALTER COLUMN id SET DEFAULT nextval('current_nodes_id_seq'::regclass);
1327 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1330 ALTER TABLE ONLY current_relations ALTER COLUMN id SET DEFAULT nextval('current_relations_id_seq'::regclass);
1334 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1337 ALTER TABLE ONLY current_ways ALTER COLUMN id SET DEFAULT nextval('current_ways_id_seq'::regclass);
1341 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1344 ALTER TABLE ONLY diary_comments ALTER COLUMN id SET DEFAULT nextval('diary_comments_id_seq'::regclass);
1348 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1351 ALTER TABLE ONLY diary_entries ALTER COLUMN id SET DEFAULT nextval('diary_entries_id_seq'::regclass);
1355 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1358 ALTER TABLE ONLY friends ALTER COLUMN id SET DEFAULT nextval('friends_id_seq'::regclass);
1362 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1365 ALTER TABLE ONLY gpx_file_tags ALTER COLUMN id SET DEFAULT nextval('gpx_file_tags_id_seq'::regclass);
1369 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1372 ALTER TABLE ONLY gpx_files ALTER COLUMN id SET DEFAULT nextval('gpx_files_id_seq'::regclass);
1376 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1379 ALTER TABLE ONLY issue_comments ALTER COLUMN id SET DEFAULT nextval('issue_comments_id_seq'::regclass);
1383 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1386 ALTER TABLE ONLY issues ALTER COLUMN id SET DEFAULT nextval('issues_id_seq'::regclass);
1390 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1393 ALTER TABLE ONLY messages ALTER COLUMN id SET DEFAULT nextval('messages_id_seq'::regclass);
1397 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1400 ALTER TABLE ONLY note_comments ALTER COLUMN id SET DEFAULT nextval('note_comments_id_seq'::regclass);
1404 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1407 ALTER TABLE ONLY notes ALTER COLUMN id SET DEFAULT nextval('notes_id_seq'::regclass);
1411 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1414 ALTER TABLE ONLY oauth_nonces ALTER COLUMN id SET DEFAULT nextval('oauth_nonces_id_seq'::regclass);
1418 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1421 ALTER TABLE ONLY oauth_tokens ALTER COLUMN id SET DEFAULT nextval('oauth_tokens_id_seq'::regclass);
1425 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1428 ALTER TABLE ONLY redactions ALTER COLUMN id SET DEFAULT nextval('redactions_id_seq'::regclass);
1432 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1435 ALTER TABLE ONLY reports ALTER COLUMN id SET DEFAULT nextval('reports_id_seq'::regclass);
1439 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1442 ALTER TABLE ONLY user_blocks ALTER COLUMN id SET DEFAULT nextval('user_blocks_id_seq'::regclass);
1446 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1449 ALTER TABLE ONLY user_roles ALTER COLUMN id SET DEFAULT nextval('user_roles_id_seq'::regclass);
1453 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1456 ALTER TABLE ONLY user_tokens ALTER COLUMN id SET DEFAULT nextval('user_tokens_id_seq'::regclass);
1460 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1463 ALTER TABLE ONLY users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass);
1467 -- Name: acls_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1470 ALTER TABLE ONLY acls
1471 ADD CONSTRAINT acls_pkey PRIMARY KEY (id);
1475 -- Name: changeset_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1478 ALTER TABLE ONLY changeset_comments
1479 ADD CONSTRAINT changeset_comments_pkey PRIMARY KEY (id);
1483 -- Name: changesets_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1486 ALTER TABLE ONLY changesets
1487 ADD CONSTRAINT changesets_pkey PRIMARY KEY (id);
1491 -- Name: client_applications_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1494 ALTER TABLE ONLY client_applications
1495 ADD CONSTRAINT client_applications_pkey PRIMARY KEY (id);
1499 -- Name: current_node_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1502 ALTER TABLE ONLY current_node_tags
1503 ADD CONSTRAINT current_node_tags_pkey PRIMARY KEY (node_id, k);
1507 -- Name: current_nodes_pkey1; Type: CONSTRAINT; Schema: public; Owner: -
1510 ALTER TABLE ONLY current_nodes
1511 ADD CONSTRAINT current_nodes_pkey1 PRIMARY KEY (id);
1515 -- Name: current_relation_members_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1518 ALTER TABLE ONLY current_relation_members
1519 ADD CONSTRAINT current_relation_members_pkey PRIMARY KEY (relation_id, member_type, member_id, member_role, sequence_id);
1523 -- Name: current_relation_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1526 ALTER TABLE ONLY current_relation_tags
1527 ADD CONSTRAINT current_relation_tags_pkey PRIMARY KEY (relation_id, k);
1531 -- Name: current_relations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1534 ALTER TABLE ONLY current_relations
1535 ADD CONSTRAINT current_relations_pkey PRIMARY KEY (id);
1539 -- Name: current_way_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1542 ALTER TABLE ONLY current_way_nodes
1543 ADD CONSTRAINT current_way_nodes_pkey PRIMARY KEY (way_id, sequence_id);
1547 -- Name: current_way_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1550 ALTER TABLE ONLY current_way_tags
1551 ADD CONSTRAINT current_way_tags_pkey PRIMARY KEY (way_id, k);
1555 -- Name: current_ways_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1558 ALTER TABLE ONLY current_ways
1559 ADD CONSTRAINT current_ways_pkey PRIMARY KEY (id);
1563 -- Name: diary_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1566 ALTER TABLE ONLY diary_comments
1567 ADD CONSTRAINT diary_comments_pkey PRIMARY KEY (id);
1571 -- Name: diary_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1574 ALTER TABLE ONLY diary_entries
1575 ADD CONSTRAINT diary_entries_pkey PRIMARY KEY (id);
1579 -- Name: friends_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1582 ALTER TABLE ONLY friends
1583 ADD CONSTRAINT friends_pkey PRIMARY KEY (id);
1587 -- Name: gpx_file_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1590 ALTER TABLE ONLY gpx_file_tags
1591 ADD CONSTRAINT gpx_file_tags_pkey PRIMARY KEY (id);
1595 -- Name: gpx_files_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1598 ALTER TABLE ONLY gpx_files
1599 ADD CONSTRAINT gpx_files_pkey PRIMARY KEY (id);
1603 -- Name: issue_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1606 ALTER TABLE ONLY issue_comments
1607 ADD CONSTRAINT issue_comments_pkey PRIMARY KEY (id);
1611 -- Name: issues_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1614 ALTER TABLE ONLY issues
1615 ADD CONSTRAINT issues_pkey PRIMARY KEY (id);
1619 -- Name: languages_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1622 ALTER TABLE ONLY languages
1623 ADD CONSTRAINT languages_pkey PRIMARY KEY (code);
1627 -- Name: messages_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1630 ALTER TABLE ONLY messages
1631 ADD CONSTRAINT messages_pkey PRIMARY KEY (id);
1635 -- Name: node_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1638 ALTER TABLE ONLY node_tags
1639 ADD CONSTRAINT node_tags_pkey PRIMARY KEY (node_id, version, k);
1643 -- Name: nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1646 ALTER TABLE ONLY nodes
1647 ADD CONSTRAINT nodes_pkey PRIMARY KEY (node_id, version);
1651 -- Name: note_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1654 ALTER TABLE ONLY note_comments
1655 ADD CONSTRAINT note_comments_pkey PRIMARY KEY (id);
1659 -- Name: notes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1662 ALTER TABLE ONLY notes
1663 ADD CONSTRAINT notes_pkey PRIMARY KEY (id);
1667 -- Name: oauth_nonces_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1670 ALTER TABLE ONLY oauth_nonces
1671 ADD CONSTRAINT oauth_nonces_pkey PRIMARY KEY (id);
1675 -- Name: oauth_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1678 ALTER TABLE ONLY oauth_tokens
1679 ADD CONSTRAINT oauth_tokens_pkey PRIMARY KEY (id);
1683 -- Name: redactions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1686 ALTER TABLE ONLY redactions
1687 ADD CONSTRAINT redactions_pkey PRIMARY KEY (id);
1691 -- Name: relation_members_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1694 ALTER TABLE ONLY relation_members
1695 ADD CONSTRAINT relation_members_pkey PRIMARY KEY (relation_id, version, member_type, member_id, member_role, sequence_id);
1699 -- Name: relation_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1702 ALTER TABLE ONLY relation_tags
1703 ADD CONSTRAINT relation_tags_pkey PRIMARY KEY (relation_id, version, k);
1707 -- Name: relations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1710 ALTER TABLE ONLY relations
1711 ADD CONSTRAINT relations_pkey PRIMARY KEY (relation_id, version);
1715 -- Name: reports_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1718 ALTER TABLE ONLY reports
1719 ADD CONSTRAINT reports_pkey PRIMARY KEY (id);
1723 -- Name: user_blocks_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1726 ALTER TABLE ONLY user_blocks
1727 ADD CONSTRAINT user_blocks_pkey PRIMARY KEY (id);
1731 -- Name: user_preferences_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1734 ALTER TABLE ONLY user_preferences
1735 ADD CONSTRAINT user_preferences_pkey PRIMARY KEY (user_id, k);
1739 -- Name: user_roles_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1742 ALTER TABLE ONLY user_roles
1743 ADD CONSTRAINT user_roles_pkey PRIMARY KEY (id);
1747 -- Name: user_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1750 ALTER TABLE ONLY user_tokens
1751 ADD CONSTRAINT user_tokens_pkey PRIMARY KEY (id);
1755 -- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1758 ALTER TABLE ONLY users
1759 ADD CONSTRAINT users_pkey PRIMARY KEY (id);
1763 -- Name: way_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1766 ALTER TABLE ONLY way_nodes
1767 ADD CONSTRAINT way_nodes_pkey PRIMARY KEY (way_id, version, sequence_id);
1771 -- Name: way_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1774 ALTER TABLE ONLY way_tags
1775 ADD CONSTRAINT way_tags_pkey PRIMARY KEY (way_id, version, k);
1779 -- Name: ways_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1782 ALTER TABLE ONLY ways
1783 ADD CONSTRAINT ways_pkey PRIMARY KEY (way_id, version);
1787 -- Name: acls_k_idx; Type: INDEX; Schema: public; Owner: -
1790 CREATE INDEX acls_k_idx ON acls USING btree (k);
1794 -- Name: changeset_tags_id_idx; Type: INDEX; Schema: public; Owner: -
1797 CREATE INDEX changeset_tags_id_idx ON changeset_tags USING btree (changeset_id);
1801 -- Name: changesets_bbox_idx; Type: INDEX; Schema: public; Owner: -
1804 CREATE INDEX changesets_bbox_idx ON changesets USING gist (min_lat, max_lat, min_lon, max_lon);
1808 -- Name: changesets_closed_at_idx; Type: INDEX; Schema: public; Owner: -
1811 CREATE INDEX changesets_closed_at_idx ON changesets USING btree (closed_at);
1815 -- Name: changesets_created_at_idx; Type: INDEX; Schema: public; Owner: -
1818 CREATE INDEX changesets_created_at_idx ON changesets USING btree (created_at);
1822 -- Name: changesets_user_id_created_at_idx; Type: INDEX; Schema: public; Owner: -
1825 CREATE INDEX changesets_user_id_created_at_idx ON changesets USING btree (user_id, created_at);
1829 -- Name: changesets_user_id_id_idx; Type: INDEX; Schema: public; Owner: -
1832 CREATE INDEX changesets_user_id_id_idx ON changesets USING btree (user_id, id);
1836 -- Name: current_nodes_tile_idx; Type: INDEX; Schema: public; Owner: -
1839 CREATE INDEX current_nodes_tile_idx ON current_nodes USING btree (tile);
1843 -- Name: current_nodes_timestamp_idx; Type: INDEX; Schema: public; Owner: -
1846 CREATE INDEX current_nodes_timestamp_idx ON current_nodes USING btree ("timestamp");
1850 -- Name: current_relation_members_member_idx; Type: INDEX; Schema: public; Owner: -
1853 CREATE INDEX current_relation_members_member_idx ON current_relation_members USING btree (member_type, member_id);
1857 -- Name: current_relations_timestamp_idx; Type: INDEX; Schema: public; Owner: -
1860 CREATE INDEX current_relations_timestamp_idx ON current_relations USING btree ("timestamp");
1864 -- Name: current_way_nodes_node_idx; Type: INDEX; Schema: public; Owner: -
1867 CREATE INDEX current_way_nodes_node_idx ON current_way_nodes USING btree (node_id);
1871 -- Name: current_ways_timestamp_idx; Type: INDEX; Schema: public; Owner: -
1874 CREATE INDEX current_ways_timestamp_idx ON current_ways USING btree ("timestamp");
1878 -- Name: diary_comment_user_id_created_at_index; Type: INDEX; Schema: public; Owner: -
1881 CREATE INDEX diary_comment_user_id_created_at_index ON diary_comments USING btree (user_id, created_at);
1885 -- Name: diary_comments_entry_id_idx; Type: INDEX; Schema: public; Owner: -
1888 CREATE UNIQUE INDEX diary_comments_entry_id_idx ON diary_comments USING btree (diary_entry_id, id);
1892 -- Name: diary_entry_created_at_index; Type: INDEX; Schema: public; Owner: -
1895 CREATE INDEX diary_entry_created_at_index ON diary_entries USING btree (created_at);
1899 -- Name: diary_entry_language_code_created_at_index; Type: INDEX; Schema: public; Owner: -
1902 CREATE INDEX diary_entry_language_code_created_at_index ON diary_entries USING btree (language_code, created_at);
1906 -- Name: diary_entry_user_id_created_at_index; Type: INDEX; Schema: public; Owner: -
1909 CREATE INDEX diary_entry_user_id_created_at_index ON diary_entries USING btree (user_id, created_at);
1913 -- Name: friends_user_id_idx; Type: INDEX; Schema: public; Owner: -
1916 CREATE INDEX friends_user_id_idx ON friends USING btree (user_id);
1920 -- Name: gpx_file_tags_gpxid_idx; Type: INDEX; Schema: public; Owner: -
1923 CREATE INDEX gpx_file_tags_gpxid_idx ON gpx_file_tags USING btree (gpx_id);
1927 -- Name: gpx_file_tags_tag_idx; Type: INDEX; Schema: public; Owner: -
1930 CREATE INDEX gpx_file_tags_tag_idx ON gpx_file_tags USING btree (tag);
1934 -- Name: gpx_files_timestamp_idx; Type: INDEX; Schema: public; Owner: -
1937 CREATE INDEX gpx_files_timestamp_idx ON gpx_files USING btree ("timestamp");
1941 -- Name: gpx_files_user_id_idx; Type: INDEX; Schema: public; Owner: -
1944 CREATE INDEX gpx_files_user_id_idx ON gpx_files USING btree (user_id);
1948 -- Name: gpx_files_visible_visibility_idx; Type: INDEX; Schema: public; Owner: -
1951 CREATE INDEX gpx_files_visible_visibility_idx ON gpx_files USING btree (visible, visibility);
1955 -- Name: index_changeset_comments_on_created_at; Type: INDEX; Schema: public; Owner: -
1958 CREATE INDEX index_changeset_comments_on_created_at ON changeset_comments USING btree (created_at);
1962 -- Name: index_changesets_subscribers_on_changeset_id; Type: INDEX; Schema: public; Owner: -
1965 CREATE INDEX index_changesets_subscribers_on_changeset_id ON changesets_subscribers USING btree (changeset_id);
1969 -- Name: index_changesets_subscribers_on_subscriber_id_and_changeset_id; Type: INDEX; Schema: public; Owner: -
1972 CREATE UNIQUE INDEX index_changesets_subscribers_on_subscriber_id_and_changeset_id ON changesets_subscribers USING btree (subscriber_id, changeset_id);
1976 -- Name: index_client_applications_on_key; Type: INDEX; Schema: public; Owner: -
1979 CREATE UNIQUE INDEX index_client_applications_on_key ON client_applications USING btree (key);
1983 -- Name: index_issue_comments_on_commenter_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
1986 CREATE INDEX index_issue_comments_on_commenter_user_id ON issue_comments USING btree (commenter_user_id);
1990 -- Name: index_issue_comments_on_issue_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
1993 CREATE INDEX index_issue_comments_on_issue_id ON issue_comments USING btree (issue_id);
1997 -- Name: index_issues_on_reportable_id_and_reportable_type; Type: INDEX; Schema: public; Owner: -; Tablespace:
2000 CREATE INDEX index_issues_on_reportable_id_and_reportable_type ON issues USING btree (reportable_id, reportable_type);
2004 -- Name: index_issues_on_reported_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
2007 CREATE INDEX index_issues_on_reported_user_id ON issues USING btree (reported_user_id);
2011 -- Name: index_issues_on_updated_by; Type: INDEX; Schema: public; Owner: -; Tablespace:
2014 CREATE INDEX index_issues_on_updated_by ON issues USING btree (updated_by);
2018 -- Name: index_note_comments_on_body; Type: INDEX; Schema: public; Owner: -
2021 CREATE INDEX index_note_comments_on_body ON note_comments USING gin (to_tsvector('english'::regconfig, body));
2025 -- Name: index_note_comments_on_created_at; Type: INDEX; Schema: public; Owner: -
2028 CREATE INDEX index_note_comments_on_created_at ON note_comments USING btree (created_at);
2032 -- Name: index_oauth_nonces_on_nonce_and_timestamp; Type: INDEX; Schema: public; Owner: -
2035 CREATE UNIQUE INDEX index_oauth_nonces_on_nonce_and_timestamp ON oauth_nonces USING btree (nonce, "timestamp");
2039 -- Name: index_oauth_tokens_on_token; Type: INDEX; Schema: public; Owner: -
2042 CREATE UNIQUE INDEX index_oauth_tokens_on_token ON oauth_tokens USING btree (token);
2046 -- Name: index_reports_on_issue_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
2049 CREATE INDEX index_reports_on_issue_id ON reports USING btree (issue_id);
2053 -- Name: index_reports_on_reporter_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
2056 CREATE INDEX index_reports_on_reporter_user_id ON reports USING btree (reporter_user_id);
2060 -- Name: index_user_blocks_on_user_id; Type: INDEX; Schema: public; Owner: -
2063 CREATE INDEX index_user_blocks_on_user_id ON user_blocks USING btree (user_id);
2067 -- Name: messages_from_user_id_idx; Type: INDEX; Schema: public; Owner: -
2070 CREATE INDEX messages_from_user_id_idx ON messages USING btree (from_user_id);
2074 -- Name: messages_to_user_id_idx; Type: INDEX; Schema: public; Owner: -
2077 CREATE INDEX messages_to_user_id_idx ON messages USING btree (to_user_id);
2081 -- Name: nodes_changeset_id_idx; Type: INDEX; Schema: public; Owner: -
2084 CREATE INDEX nodes_changeset_id_idx ON nodes USING btree (changeset_id);
2088 -- Name: nodes_tile_idx; Type: INDEX; Schema: public; Owner: -
2091 CREATE INDEX nodes_tile_idx ON nodes USING btree (tile);
2095 -- Name: nodes_timestamp_idx; Type: INDEX; Schema: public; Owner: -
2098 CREATE INDEX nodes_timestamp_idx ON nodes USING btree ("timestamp");
2102 -- Name: note_comments_note_id_idx; Type: INDEX; Schema: public; Owner: -
2105 CREATE INDEX note_comments_note_id_idx ON note_comments USING btree (note_id);
2109 -- Name: notes_created_at_idx; Type: INDEX; Schema: public; Owner: -
2112 CREATE INDEX notes_created_at_idx ON notes USING btree (created_at);
2116 -- Name: notes_tile_status_idx; Type: INDEX; Schema: public; Owner: -
2119 CREATE INDEX notes_tile_status_idx ON notes USING btree (tile, status);
2123 -- Name: notes_updated_at_idx; Type: INDEX; Schema: public; Owner: -
2126 CREATE INDEX notes_updated_at_idx ON notes USING btree (updated_at);
2130 -- Name: points_gpxid_idx; Type: INDEX; Schema: public; Owner: -
2133 CREATE INDEX points_gpxid_idx ON gps_points USING btree (gpx_id);
2137 -- Name: points_tile_idx; Type: INDEX; Schema: public; Owner: -
2140 CREATE INDEX points_tile_idx ON gps_points USING btree (tile);
2144 -- Name: relation_members_member_idx; Type: INDEX; Schema: public; Owner: -
2147 CREATE INDEX relation_members_member_idx ON relation_members USING btree (member_type, member_id);
2151 -- Name: relations_changeset_id_idx; Type: INDEX; Schema: public; Owner: -
2154 CREATE INDEX relations_changeset_id_idx ON relations USING btree (changeset_id);
2158 -- Name: relations_timestamp_idx; Type: INDEX; Schema: public; Owner: -
2161 CREATE INDEX relations_timestamp_idx ON relations USING btree ("timestamp");
2165 -- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -
2168 CREATE UNIQUE INDEX unique_schema_migrations ON schema_migrations USING btree (version);
2172 -- Name: user_id_idx; Type: INDEX; Schema: public; Owner: -
2175 CREATE INDEX user_id_idx ON friends USING btree (friend_user_id);
2179 -- Name: user_roles_id_role_unique; Type: INDEX; Schema: public; Owner: -
2182 CREATE UNIQUE INDEX user_roles_id_role_unique ON user_roles USING btree (user_id, role);
2186 -- Name: user_tokens_token_idx; Type: INDEX; Schema: public; Owner: -
2189 CREATE UNIQUE INDEX user_tokens_token_idx ON user_tokens USING btree (token);
2193 -- Name: user_tokens_user_id_idx; Type: INDEX; Schema: public; Owner: -
2196 CREATE INDEX user_tokens_user_id_idx ON user_tokens USING btree (user_id);
2200 -- Name: users_auth_idx; Type: INDEX; Schema: public; Owner: -
2203 CREATE UNIQUE INDEX users_auth_idx ON users USING btree (auth_provider, auth_uid);
2207 -- Name: users_display_name_idx; Type: INDEX; Schema: public; Owner: -
2210 CREATE UNIQUE INDEX users_display_name_idx ON users USING btree (display_name);
2214 -- Name: users_display_name_lower_idx; Type: INDEX; Schema: public; Owner: -
2217 CREATE INDEX users_display_name_lower_idx ON users USING btree (lower((display_name)::text));
2221 -- Name: users_email_idx; Type: INDEX; Schema: public; Owner: -
2224 CREATE UNIQUE INDEX users_email_idx ON users USING btree (email);
2228 -- Name: users_email_lower_idx; Type: INDEX; Schema: public; Owner: -
2231 CREATE INDEX users_email_lower_idx ON users USING btree (lower((email)::text));
2235 -- Name: way_nodes_node_idx; Type: INDEX; Schema: public; Owner: -
2238 CREATE INDEX way_nodes_node_idx ON way_nodes USING btree (node_id);
2242 -- Name: ways_changeset_id_idx; Type: INDEX; Schema: public; Owner: -
2245 CREATE INDEX ways_changeset_id_idx ON ways USING btree (changeset_id);
2249 -- Name: ways_timestamp_idx; Type: INDEX; Schema: public; Owner: -
2252 CREATE INDEX ways_timestamp_idx ON ways USING btree ("timestamp");
2256 -- Name: changeset_comments_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2259 ALTER TABLE ONLY changeset_comments
2260 ADD CONSTRAINT changeset_comments_author_id_fkey FOREIGN KEY (author_id) REFERENCES users(id);
2264 -- Name: changeset_comments_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2267 ALTER TABLE ONLY changeset_comments
2268 ADD CONSTRAINT changeset_comments_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2272 -- Name: changeset_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2275 ALTER TABLE ONLY changeset_tags
2276 ADD CONSTRAINT changeset_tags_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2280 -- Name: changesets_subscribers_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2283 ALTER TABLE ONLY changesets_subscribers
2284 ADD CONSTRAINT changesets_subscribers_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2288 -- Name: changesets_subscribers_subscriber_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2291 ALTER TABLE ONLY changesets_subscribers
2292 ADD CONSTRAINT changesets_subscribers_subscriber_id_fkey FOREIGN KEY (subscriber_id) REFERENCES users(id);
2296 -- Name: changesets_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2299 ALTER TABLE ONLY changesets
2300 ADD CONSTRAINT changesets_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2304 -- Name: client_applications_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2307 ALTER TABLE ONLY client_applications
2308 ADD CONSTRAINT client_applications_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2312 -- Name: current_node_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2315 ALTER TABLE ONLY current_node_tags
2316 ADD CONSTRAINT current_node_tags_id_fkey FOREIGN KEY (node_id) REFERENCES current_nodes(id);
2320 -- Name: current_nodes_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2323 ALTER TABLE ONLY current_nodes
2324 ADD CONSTRAINT current_nodes_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2328 -- Name: current_relation_members_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2331 ALTER TABLE ONLY current_relation_members
2332 ADD CONSTRAINT current_relation_members_id_fkey FOREIGN KEY (relation_id) REFERENCES current_relations(id);
2336 -- Name: current_relation_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2339 ALTER TABLE ONLY current_relation_tags
2340 ADD CONSTRAINT current_relation_tags_id_fkey FOREIGN KEY (relation_id) REFERENCES current_relations(id);
2344 -- Name: current_relations_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2347 ALTER TABLE ONLY current_relations
2348 ADD CONSTRAINT current_relations_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2352 -- Name: current_way_nodes_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2355 ALTER TABLE ONLY current_way_nodes
2356 ADD CONSTRAINT current_way_nodes_id_fkey FOREIGN KEY (way_id) REFERENCES current_ways(id);
2360 -- Name: current_way_nodes_node_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2363 ALTER TABLE ONLY current_way_nodes
2364 ADD CONSTRAINT current_way_nodes_node_id_fkey FOREIGN KEY (node_id) REFERENCES current_nodes(id);
2368 -- Name: current_way_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2371 ALTER TABLE ONLY current_way_tags
2372 ADD CONSTRAINT current_way_tags_id_fkey FOREIGN KEY (way_id) REFERENCES current_ways(id);
2376 -- Name: current_ways_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2379 ALTER TABLE ONLY current_ways
2380 ADD CONSTRAINT current_ways_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2384 -- Name: diary_comments_diary_entry_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2387 ALTER TABLE ONLY diary_comments
2388 ADD CONSTRAINT diary_comments_diary_entry_id_fkey FOREIGN KEY (diary_entry_id) REFERENCES diary_entries(id);
2392 -- Name: diary_comments_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2395 ALTER TABLE ONLY diary_comments
2396 ADD CONSTRAINT diary_comments_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2400 -- Name: diary_entries_language_code_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2403 ALTER TABLE ONLY diary_entries
2404 ADD CONSTRAINT diary_entries_language_code_fkey FOREIGN KEY (language_code) REFERENCES languages(code);
2408 -- Name: diary_entries_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2411 ALTER TABLE ONLY diary_entries
2412 ADD CONSTRAINT diary_entries_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2416 -- Name: friends_friend_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2419 ALTER TABLE ONLY friends
2420 ADD CONSTRAINT friends_friend_user_id_fkey FOREIGN KEY (friend_user_id) REFERENCES users(id);
2424 -- Name: friends_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2427 ALTER TABLE ONLY friends
2428 ADD CONSTRAINT friends_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2432 -- Name: gps_points_gpx_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2435 ALTER TABLE ONLY gps_points
2436 ADD CONSTRAINT gps_points_gpx_id_fkey FOREIGN KEY (gpx_id) REFERENCES gpx_files(id);
2440 -- Name: gpx_file_tags_gpx_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2443 ALTER TABLE ONLY gpx_file_tags
2444 ADD CONSTRAINT gpx_file_tags_gpx_id_fkey FOREIGN KEY (gpx_id) REFERENCES gpx_files(id);
2448 -- Name: gpx_files_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2451 ALTER TABLE ONLY gpx_files
2452 ADD CONSTRAINT gpx_files_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2456 -- Name: issue_comments_commenter_user_id; Type: FK CONSTRAINT; Schema: public; Owner: -
2459 ALTER TABLE ONLY issue_comments
2460 ADD CONSTRAINT issue_comments_commenter_user_id FOREIGN KEY (commenter_user_id) REFERENCES users(id) ON DELETE CASCADE;
2464 -- Name: issue_comments_issue_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2467 ALTER TABLE ONLY issue_comments
2468 ADD CONSTRAINT issue_comments_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
2472 -- Name: issues_reported_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2475 ALTER TABLE ONLY issues
2476 ADD CONSTRAINT issues_reported_user_id_fkey FOREIGN KEY (reported_user_id) REFERENCES users(id) ON DELETE CASCADE;
2480 -- Name: issues_updated_by_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2483 ALTER TABLE ONLY issues
2484 ADD CONSTRAINT issues_updated_by_fkey FOREIGN KEY (updated_by) REFERENCES users(id) ON DELETE CASCADE;
2488 -- Name: messages_from_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2491 ALTER TABLE ONLY messages
2492 ADD CONSTRAINT messages_from_user_id_fkey FOREIGN KEY (from_user_id) REFERENCES users(id);
2496 -- Name: messages_to_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2499 ALTER TABLE ONLY messages
2500 ADD CONSTRAINT messages_to_user_id_fkey FOREIGN KEY (to_user_id) REFERENCES users(id);
2504 -- Name: node_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2507 ALTER TABLE ONLY node_tags
2508 ADD CONSTRAINT node_tags_id_fkey FOREIGN KEY (node_id, version) REFERENCES nodes(node_id, version);
2512 -- Name: nodes_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2515 ALTER TABLE ONLY nodes
2516 ADD CONSTRAINT nodes_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2520 -- Name: nodes_redaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2523 ALTER TABLE ONLY nodes
2524 ADD CONSTRAINT nodes_redaction_id_fkey FOREIGN KEY (redaction_id) REFERENCES redactions(id);
2528 -- Name: note_comments_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2531 ALTER TABLE ONLY note_comments
2532 ADD CONSTRAINT note_comments_author_id_fkey FOREIGN KEY (author_id) REFERENCES users(id);
2536 -- Name: note_comments_note_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2539 ALTER TABLE ONLY note_comments
2540 ADD CONSTRAINT note_comments_note_id_fkey FOREIGN KEY (note_id) REFERENCES notes(id);
2544 -- Name: oauth_tokens_client_application_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2547 ALTER TABLE ONLY oauth_tokens
2548 ADD CONSTRAINT oauth_tokens_client_application_id_fkey FOREIGN KEY (client_application_id) REFERENCES client_applications(id);
2552 -- Name: oauth_tokens_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2555 ALTER TABLE ONLY oauth_tokens
2556 ADD CONSTRAINT oauth_tokens_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2560 -- Name: redactions_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2563 ALTER TABLE ONLY redactions
2564 ADD CONSTRAINT redactions_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2568 -- Name: relation_members_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2571 ALTER TABLE ONLY relation_members
2572 ADD CONSTRAINT relation_members_id_fkey FOREIGN KEY (relation_id, version) REFERENCES relations(relation_id, version);
2576 -- Name: relation_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2579 ALTER TABLE ONLY relation_tags
2580 ADD CONSTRAINT relation_tags_id_fkey FOREIGN KEY (relation_id, version) REFERENCES relations(relation_id, version);
2584 -- Name: relations_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2587 ALTER TABLE ONLY relations
2588 ADD CONSTRAINT relations_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2592 -- Name: relations_redaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2595 ALTER TABLE ONLY relations
2596 ADD CONSTRAINT relations_redaction_id_fkey FOREIGN KEY (redaction_id) REFERENCES redactions(id);
2600 -- Name: reports_issue_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2603 ALTER TABLE ONLY reports
2604 ADD CONSTRAINT reports_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
2608 -- Name: reports_reporter_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2611 ALTER TABLE ONLY reports
2612 ADD CONSTRAINT reports_reporter_user_id_fkey FOREIGN KEY (reporter_user_id) REFERENCES users(id) ON DELETE CASCADE;
2616 -- Name: user_blocks_moderator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2619 ALTER TABLE ONLY user_blocks
2620 ADD CONSTRAINT user_blocks_moderator_id_fkey FOREIGN KEY (creator_id) REFERENCES users(id);
2624 -- Name: user_blocks_revoker_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2627 ALTER TABLE ONLY user_blocks
2628 ADD CONSTRAINT user_blocks_revoker_id_fkey FOREIGN KEY (revoker_id) REFERENCES users(id);
2632 -- Name: user_blocks_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2635 ALTER TABLE ONLY user_blocks
2636 ADD CONSTRAINT user_blocks_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2640 -- Name: user_preferences_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2643 ALTER TABLE ONLY user_preferences
2644 ADD CONSTRAINT user_preferences_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2648 -- Name: user_roles_granter_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2651 ALTER TABLE ONLY user_roles
2652 ADD CONSTRAINT user_roles_granter_id_fkey FOREIGN KEY (granter_id) REFERENCES users(id);
2656 -- Name: user_roles_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2659 ALTER TABLE ONLY user_roles
2660 ADD CONSTRAINT user_roles_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2664 -- Name: user_tokens_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2667 ALTER TABLE ONLY user_tokens
2668 ADD CONSTRAINT user_tokens_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2672 -- Name: way_nodes_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2675 ALTER TABLE ONLY way_nodes
2676 ADD CONSTRAINT way_nodes_id_fkey FOREIGN KEY (way_id, version) REFERENCES ways(way_id, version);
2680 -- Name: way_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2683 ALTER TABLE ONLY way_tags
2684 ADD CONSTRAINT way_tags_id_fkey FOREIGN KEY (way_id, version) REFERENCES ways(way_id, version);
2688 -- Name: ways_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2691 ALTER TABLE ONLY ways
2692 ADD CONSTRAINT ways_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2696 -- Name: ways_redaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2699 ALTER TABLE ONLY ways
2700 ADD CONSTRAINT ways_redaction_id_fkey FOREIGN KEY (redaction_id) REFERENCES redactions(id);
2704 -- PostgreSQL database dump complete
2707 SET search_path TO "$user", public;
2709 INSERT INTO schema_migrations (version) VALUES ('1');
2711 INSERT INTO schema_migrations (version) VALUES ('10');
2713 INSERT INTO schema_migrations (version) VALUES ('11');
2715 INSERT INTO schema_migrations (version) VALUES ('12');
2717 INSERT INTO schema_migrations (version) VALUES ('13');
2719 INSERT INTO schema_migrations (version) VALUES ('14');
2721 INSERT INTO schema_migrations (version) VALUES ('15');
2723 INSERT INTO schema_migrations (version) VALUES ('16');
2725 INSERT INTO schema_migrations (version) VALUES ('17');
2727 INSERT INTO schema_migrations (version) VALUES ('18');
2729 INSERT INTO schema_migrations (version) VALUES ('19');
2731 INSERT INTO schema_migrations (version) VALUES ('2');
2733 INSERT INTO schema_migrations (version) VALUES ('20');
2735 INSERT INTO schema_migrations (version) VALUES ('20100513171259');
2737 INSERT INTO schema_migrations (version) VALUES ('20100516124737');
2739 INSERT INTO schema_migrations (version) VALUES ('20100910084426');
2741 INSERT INTO schema_migrations (version) VALUES ('20101114011429');
2743 INSERT INTO schema_migrations (version) VALUES ('20110322001319');
2745 INSERT INTO schema_migrations (version) VALUES ('20110508145337');
2747 INSERT INTO schema_migrations (version) VALUES ('20110521142405');
2749 INSERT INTO schema_migrations (version) VALUES ('20110925112722');
2751 INSERT INTO schema_migrations (version) VALUES ('20111116184519');
2753 INSERT INTO schema_migrations (version) VALUES ('20111212183945');
2755 INSERT INTO schema_migrations (version) VALUES ('20120123184321');
2757 INSERT INTO schema_migrations (version) VALUES ('20120208122334');
2759 INSERT INTO schema_migrations (version) VALUES ('20120208194454');
2761 INSERT INTO schema_migrations (version) VALUES ('20120214210114');
2763 INSERT INTO schema_migrations (version) VALUES ('20120219161649');
2765 INSERT INTO schema_migrations (version) VALUES ('20120318201948');
2767 INSERT INTO schema_migrations (version) VALUES ('20120328090602');
2769 INSERT INTO schema_migrations (version) VALUES ('20120404205604');
2771 INSERT INTO schema_migrations (version) VALUES ('20120808231205');
2773 INSERT INTO schema_migrations (version) VALUES ('20121005195010');
2775 INSERT INTO schema_migrations (version) VALUES ('20121012044047');
2777 INSERT INTO schema_migrations (version) VALUES ('20121119165817');
2779 INSERT INTO schema_migrations (version) VALUES ('20121202155309');
2781 INSERT INTO schema_migrations (version) VALUES ('20121203124841');
2783 INSERT INTO schema_migrations (version) VALUES ('20130328184137');
2785 INSERT INTO schema_migrations (version) VALUES ('20131029121300');
2787 INSERT INTO schema_migrations (version) VALUES ('20131212124700');
2789 INSERT INTO schema_migrations (version) VALUES ('20140115192822');
2791 INSERT INTO schema_migrations (version) VALUES ('20140117185510');
2793 INSERT INTO schema_migrations (version) VALUES ('20140210003018');
2795 INSERT INTO schema_migrations (version) VALUES ('20140507110937');
2797 INSERT INTO schema_migrations (version) VALUES ('20140519141742');
2799 INSERT INTO schema_migrations (version) VALUES ('20150110152606');
2801 INSERT INTO schema_migrations (version) VALUES ('20150111192335');
2803 INSERT INTO schema_migrations (version) VALUES ('20150222101847');
2805 INSERT INTO schema_migrations (version) VALUES ('20150516073616');
2807 INSERT INTO schema_migrations (version) VALUES ('20150526130032');
2809 INSERT INTO schema_migrations (version) VALUES ('20150719160821');
2811 INSERT INTO schema_migrations (version) VALUES ('21');
2813 INSERT INTO schema_migrations (version) VALUES ('22');
2815 INSERT INTO schema_migrations (version) VALUES ('23');
2817 INSERT INTO schema_migrations (version) VALUES ('24');
2819 INSERT INTO schema_migrations (version) VALUES ('25');
2821 INSERT INTO schema_migrations (version) VALUES ('26');
2823 INSERT INTO schema_migrations (version) VALUES ('27');
2825 INSERT INTO schema_migrations (version) VALUES ('28');
2827 INSERT INTO schema_migrations (version) VALUES ('29');
2829 INSERT INTO schema_migrations (version) VALUES ('3');
2831 INSERT INTO schema_migrations (version) VALUES ('30');
2833 INSERT INTO schema_migrations (version) VALUES ('31');
2835 INSERT INTO schema_migrations (version) VALUES ('32');
2837 INSERT INTO schema_migrations (version) VALUES ('33');
2839 INSERT INTO schema_migrations (version) VALUES ('34');
2841 INSERT INTO schema_migrations (version) VALUES ('35');
2843 INSERT INTO schema_migrations (version) VALUES ('36');
2845 INSERT INTO schema_migrations (version) VALUES ('37');
2847 INSERT INTO schema_migrations (version) VALUES ('38');
2849 INSERT INTO schema_migrations (version) VALUES ('39');
2851 INSERT INTO schema_migrations (version) VALUES ('4');
2853 INSERT INTO schema_migrations (version) VALUES ('40');
2855 INSERT INTO schema_migrations (version) VALUES ('41');
2857 INSERT INTO schema_migrations (version) VALUES ('42');
2859 INSERT INTO schema_migrations (version) VALUES ('43');
2861 INSERT INTO schema_migrations (version) VALUES ('44');
2863 INSERT INTO schema_migrations (version) VALUES ('45');
2865 INSERT INTO schema_migrations (version) VALUES ('46');
2867 INSERT INTO schema_migrations (version) VALUES ('47');
2869 INSERT INTO schema_migrations (version) VALUES ('48');
2871 INSERT INTO schema_migrations (version) VALUES ('49');
2873 INSERT INTO schema_migrations (version) VALUES ('5');
2875 INSERT INTO schema_migrations (version) VALUES ('50');
2877 INSERT INTO schema_migrations (version) VALUES ('51');
2879 INSERT INTO schema_migrations (version) VALUES ('52');
2881 INSERT INTO schema_migrations (version) VALUES ('53');
2883 INSERT INTO schema_migrations (version) VALUES ('54');
2885 INSERT INTO schema_migrations (version) VALUES ('55');
2887 INSERT INTO schema_migrations (version) VALUES ('56');
2889 INSERT INTO schema_migrations (version) VALUES ('57');
2891 INSERT INTO schema_migrations (version) VALUES ('6');
2893 INSERT INTO schema_migrations (version) VALUES ('7');
2895 INSERT INTO schema_migrations (version) VALUES ('8');
2897 INSERT INTO schema_migrations (version) VALUES ('9');