2 -- PostgreSQL database dump
5 SET statement_timeout = 0;
7 SET client_encoding = 'UTF8';
8 SET standard_conforming_strings = on;
9 SET check_function_bodies = false;
10 SET client_min_messages = warning;
13 -- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
16 CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
20 -- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
23 COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
27 -- Name: btree_gist; Type: EXTENSION; Schema: -; Owner: -
30 CREATE EXTENSION IF NOT EXISTS btree_gist WITH SCHEMA public;
34 -- Name: EXTENSION btree_gist; Type: COMMENT; Schema: -; Owner: -
37 COMMENT ON EXTENSION btree_gist IS 'support for indexing common datatypes in GiST';
40 SET search_path = public, pg_catalog;
43 -- Name: format_enum; Type: TYPE; Schema: public; Owner: -
46 CREATE TYPE format_enum AS ENUM (
54 -- Name: gpx_visibility_enum; Type: TYPE; Schema: public; Owner: -
57 CREATE TYPE gpx_visibility_enum AS ENUM (
66 -- Name: note_event_enum; Type: TYPE; Schema: public; Owner: -
69 CREATE TYPE note_event_enum AS ENUM (
79 -- Name: note_status_enum; Type: TYPE; Schema: public; Owner: -
82 CREATE TYPE note_status_enum AS ENUM (
90 -- Name: nwr_enum; Type: TYPE; Schema: public; Owner: -
93 CREATE TYPE nwr_enum AS ENUM (
101 -- Name: user_role_enum; Type: TYPE; Schema: public; Owner: -
104 CREATE TYPE user_role_enum AS ENUM (
111 -- Name: user_status_enum; Type: TYPE; Schema: public; Owner: -
114 CREATE TYPE user_status_enum AS ENUM (
124 -- Name: maptile_for_point(bigint, bigint, integer); Type: FUNCTION; Schema: public; Owner: -
127 CREATE FUNCTION maptile_for_point(bigint, bigint, integer) RETURNS integer
129 AS '/srv/www/master.osm.compton.nu/db/functions/libpgosm.so', 'maptile_for_point';
133 -- Name: tile_for_point(integer, integer); Type: FUNCTION; Schema: public; Owner: -
136 CREATE FUNCTION tile_for_point(integer, integer) RETURNS bigint
138 AS '/srv/www/master.osm.compton.nu/db/functions/libpgosm.so', 'tile_for_point';
142 -- Name: xid_to_int4(xid); Type: FUNCTION; Schema: public; Owner: -
145 CREATE FUNCTION xid_to_int4(xid) RETURNS integer
146 LANGUAGE c IMMUTABLE STRICT
147 AS '/srv/www/master.osm.compton.nu/db/functions/libpgosm.so', 'xid_to_int4';
150 SET default_tablespace = '';
152 SET default_with_oids = false;
155 -- Name: acls; Type: TABLE; Schema: public; Owner: -; Tablespace:
161 k character varying(255) NOT NULL,
162 v character varying(255),
163 domain character varying(255)
168 -- Name: acls_id_seq; Type: SEQUENCE; Schema: public; Owner: -
171 CREATE SEQUENCE acls_id_seq
180 -- Name: acls_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
183 ALTER SEQUENCE acls_id_seq OWNED BY acls.id;
187 -- Name: changeset_tags; Type: TABLE; Schema: public; Owner: -; Tablespace:
190 CREATE TABLE changeset_tags (
191 changeset_id bigint NOT NULL,
192 k character varying(255) DEFAULT ''::character varying NOT NULL,
193 v character varying(255) DEFAULT ''::character varying NOT NULL
198 -- Name: changesets; Type: TABLE; Schema: public; Owner: -; Tablespace:
201 CREATE TABLE changesets (
203 user_id bigint NOT NULL,
204 created_at timestamp without time zone NOT NULL,
209 closed_at timestamp without time zone NOT NULL,
210 num_changes integer DEFAULT 0 NOT NULL
215 -- Name: changesets_id_seq; Type: SEQUENCE; Schema: public; Owner: -
218 CREATE SEQUENCE changesets_id_seq
227 -- Name: changesets_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
230 ALTER SEQUENCE changesets_id_seq OWNED BY changesets.id;
234 -- Name: client_applications; Type: TABLE; Schema: public; Owner: -; Tablespace:
237 CREATE TABLE client_applications (
239 name character varying(255),
240 url character varying(255),
241 support_url character varying(255),
242 callback_url character varying(255),
243 key character varying(50),
244 secret character varying(50),
246 created_at timestamp without time zone,
247 updated_at timestamp without time zone,
248 allow_read_prefs boolean DEFAULT false NOT NULL,
249 allow_write_prefs boolean DEFAULT false NOT NULL,
250 allow_write_diary boolean DEFAULT false NOT NULL,
251 allow_write_api boolean DEFAULT false NOT NULL,
252 allow_read_gpx boolean DEFAULT false NOT NULL,
253 allow_write_gpx boolean DEFAULT false NOT NULL,
254 allow_write_notes boolean DEFAULT false NOT NULL
259 -- Name: client_applications_id_seq; Type: SEQUENCE; Schema: public; Owner: -
262 CREATE SEQUENCE client_applications_id_seq
271 -- Name: client_applications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
274 ALTER SEQUENCE client_applications_id_seq OWNED BY client_applications.id;
278 -- Name: countries; Type: TABLE; Schema: public; Owner: -; Tablespace:
281 CREATE TABLE countries (
283 code character varying(2) NOT NULL,
284 min_lat double precision NOT NULL,
285 max_lat double precision NOT NULL,
286 min_lon double precision NOT NULL,
287 max_lon double precision NOT NULL
292 -- Name: countries_id_seq; Type: SEQUENCE; Schema: public; Owner: -
295 CREATE SEQUENCE countries_id_seq
304 -- Name: countries_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
307 ALTER SEQUENCE countries_id_seq OWNED BY countries.id;
311 -- Name: current_node_tags; Type: TABLE; Schema: public; Owner: -; Tablespace:
314 CREATE TABLE current_node_tags (
315 node_id bigint NOT NULL,
316 k character varying(255) DEFAULT ''::character varying NOT NULL,
317 v character varying(255) DEFAULT ''::character varying NOT NULL
322 -- Name: current_nodes; Type: TABLE; Schema: public; Owner: -; Tablespace:
325 CREATE TABLE current_nodes (
327 latitude integer NOT NULL,
328 longitude integer NOT NULL,
329 changeset_id bigint NOT NULL,
330 visible boolean NOT NULL,
331 "timestamp" timestamp without time zone NOT NULL,
332 tile bigint NOT NULL,
333 version bigint NOT NULL
338 -- Name: current_nodes_id_seq; Type: SEQUENCE; Schema: public; Owner: -
341 CREATE SEQUENCE current_nodes_id_seq
350 -- Name: current_nodes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
353 ALTER SEQUENCE current_nodes_id_seq OWNED BY current_nodes.id;
357 -- Name: current_relation_members; Type: TABLE; Schema: public; Owner: -; Tablespace:
360 CREATE TABLE current_relation_members (
361 relation_id bigint NOT NULL,
362 member_type nwr_enum NOT NULL,
363 member_id bigint NOT NULL,
364 member_role character varying(255) NOT NULL,
365 sequence_id integer DEFAULT 0 NOT NULL
370 -- Name: current_relation_tags; Type: TABLE; Schema: public; Owner: -; Tablespace:
373 CREATE TABLE current_relation_tags (
374 relation_id bigint NOT NULL,
375 k character varying(255) DEFAULT ''::character varying NOT NULL,
376 v character varying(255) DEFAULT ''::character varying NOT NULL
381 -- Name: current_relations; Type: TABLE; Schema: public; Owner: -; Tablespace:
384 CREATE TABLE current_relations (
386 changeset_id bigint NOT NULL,
387 "timestamp" timestamp without time zone NOT NULL,
388 visible boolean NOT NULL,
389 version bigint NOT NULL
394 -- Name: current_relations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
397 CREATE SEQUENCE current_relations_id_seq
406 -- Name: current_relations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
409 ALTER SEQUENCE current_relations_id_seq OWNED BY current_relations.id;
413 -- Name: current_way_nodes; Type: TABLE; Schema: public; Owner: -; Tablespace:
416 CREATE TABLE current_way_nodes (
417 way_id bigint NOT NULL,
418 node_id bigint NOT NULL,
419 sequence_id bigint NOT NULL
424 -- Name: current_way_tags; Type: TABLE; Schema: public; Owner: -; Tablespace:
427 CREATE TABLE current_way_tags (
428 way_id bigint NOT NULL,
429 k character varying(255) DEFAULT ''::character varying NOT NULL,
430 v character varying(255) DEFAULT ''::character varying NOT NULL
435 -- Name: current_ways; Type: TABLE; Schema: public; Owner: -; Tablespace:
438 CREATE TABLE current_ways (
440 changeset_id bigint NOT NULL,
441 "timestamp" timestamp without time zone NOT NULL,
442 visible boolean NOT NULL,
443 version bigint NOT NULL
448 -- Name: current_ways_id_seq; Type: SEQUENCE; Schema: public; Owner: -
451 CREATE SEQUENCE current_ways_id_seq
460 -- Name: current_ways_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
463 ALTER SEQUENCE current_ways_id_seq OWNED BY current_ways.id;
467 -- Name: diary_comments; Type: TABLE; Schema: public; Owner: -; Tablespace:
470 CREATE TABLE diary_comments (
472 diary_entry_id bigint NOT NULL,
473 user_id bigint NOT NULL,
475 created_at timestamp without time zone NOT NULL,
476 updated_at timestamp without time zone NOT NULL,
477 visible boolean DEFAULT true NOT NULL,
478 body_format format_enum DEFAULT 'html'::format_enum NOT NULL
483 -- Name: diary_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
486 CREATE SEQUENCE diary_comments_id_seq
495 -- Name: diary_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
498 ALTER SEQUENCE diary_comments_id_seq OWNED BY diary_comments.id;
502 -- Name: diary_entries; Type: TABLE; Schema: public; Owner: -; Tablespace:
505 CREATE TABLE diary_entries (
507 user_id bigint NOT NULL,
508 title character varying(255) NOT NULL,
510 created_at timestamp without time zone NOT NULL,
511 updated_at timestamp without time zone NOT NULL,
512 latitude double precision,
513 longitude double precision,
514 language_code character varying(255) DEFAULT 'en'::character varying NOT NULL,
515 visible boolean DEFAULT true NOT NULL,
516 body_format format_enum DEFAULT 'html'::format_enum NOT NULL
521 -- Name: diary_entries_id_seq; Type: SEQUENCE; Schema: public; Owner: -
524 CREATE SEQUENCE diary_entries_id_seq
533 -- Name: diary_entries_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
536 ALTER SEQUENCE diary_entries_id_seq OWNED BY diary_entries.id;
540 -- Name: friends; Type: TABLE; Schema: public; Owner: -; Tablespace:
543 CREATE TABLE friends (
545 user_id bigint NOT NULL,
546 friend_user_id bigint NOT NULL
551 -- Name: friends_id_seq; Type: SEQUENCE; Schema: public; Owner: -
554 CREATE SEQUENCE friends_id_seq
563 -- Name: friends_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
566 ALTER SEQUENCE friends_id_seq OWNED BY friends.id;
570 -- Name: gps_points; Type: TABLE; Schema: public; Owner: -; Tablespace:
573 CREATE TABLE gps_points (
574 altitude double precision,
575 trackid integer NOT NULL,
576 latitude integer NOT NULL,
577 longitude integer NOT NULL,
578 gpx_id bigint NOT NULL,
579 "timestamp" timestamp without time zone,
585 -- Name: gpx_file_tags; Type: TABLE; Schema: public; Owner: -; Tablespace:
588 CREATE TABLE gpx_file_tags (
589 gpx_id bigint DEFAULT 0 NOT NULL,
590 tag character varying(255) NOT NULL,
596 -- Name: gpx_file_tags_id_seq; Type: SEQUENCE; Schema: public; Owner: -
599 CREATE SEQUENCE gpx_file_tags_id_seq
608 -- Name: gpx_file_tags_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
611 ALTER SEQUENCE gpx_file_tags_id_seq OWNED BY gpx_file_tags.id;
615 -- Name: gpx_files; Type: TABLE; Schema: public; Owner: -; Tablespace:
618 CREATE TABLE gpx_files (
620 user_id bigint NOT NULL,
621 visible boolean DEFAULT true NOT NULL,
622 name character varying(255) DEFAULT ''::character varying NOT NULL,
624 latitude double precision,
625 longitude double precision,
626 "timestamp" timestamp without time zone NOT NULL,
627 description character varying(255) DEFAULT ''::character varying NOT NULL,
628 inserted boolean NOT NULL,
629 visibility gpx_visibility_enum DEFAULT 'public'::gpx_visibility_enum NOT NULL
634 -- Name: gpx_files_id_seq; Type: SEQUENCE; Schema: public; Owner: -
637 CREATE SEQUENCE gpx_files_id_seq
646 -- Name: gpx_files_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
649 ALTER SEQUENCE gpx_files_id_seq OWNED BY gpx_files.id;
653 -- Name: languages; Type: TABLE; Schema: public; Owner: -; Tablespace:
656 CREATE TABLE languages (
657 code character varying(255) NOT NULL,
658 english_name character varying(255) NOT NULL,
659 native_name character varying(255)
664 -- Name: messages; Type: TABLE; Schema: public; Owner: -; Tablespace:
667 CREATE TABLE messages (
669 from_user_id bigint NOT NULL,
670 title character varying(255) NOT NULL,
672 sent_on timestamp without time zone NOT NULL,
673 message_read boolean DEFAULT false NOT NULL,
674 to_user_id bigint NOT NULL,
675 to_user_visible boolean DEFAULT true NOT NULL,
676 from_user_visible boolean DEFAULT true NOT NULL,
677 body_format format_enum DEFAULT 'html'::format_enum NOT NULL
682 -- Name: messages_id_seq; Type: SEQUENCE; Schema: public; Owner: -
685 CREATE SEQUENCE messages_id_seq
694 -- Name: messages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
697 ALTER SEQUENCE messages_id_seq OWNED BY messages.id;
701 -- Name: node_tags; Type: TABLE; Schema: public; Owner: -; Tablespace:
704 CREATE TABLE node_tags (
705 node_id bigint NOT NULL,
706 version bigint NOT NULL,
707 k character varying(255) DEFAULT ''::character varying NOT NULL,
708 v character varying(255) DEFAULT ''::character varying NOT NULL
713 -- Name: nodes; Type: TABLE; Schema: public; Owner: -; Tablespace:
717 node_id bigint NOT NULL,
718 latitude integer NOT NULL,
719 longitude integer NOT NULL,
720 changeset_id bigint NOT NULL,
721 visible boolean NOT NULL,
722 "timestamp" timestamp without time zone NOT NULL,
723 tile bigint NOT NULL,
724 version bigint NOT NULL,
730 -- Name: note_comments; Type: TABLE; Schema: public; Owner: -; Tablespace:
733 CREATE TABLE note_comments (
735 note_id bigint NOT NULL,
736 visible boolean NOT NULL,
737 created_at timestamp without time zone NOT NULL,
741 event note_event_enum
746 -- Name: note_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
749 CREATE SEQUENCE note_comments_id_seq
758 -- Name: note_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
761 ALTER SEQUENCE note_comments_id_seq OWNED BY note_comments.id;
765 -- Name: notes; Type: TABLE; Schema: public; Owner: -; Tablespace:
770 latitude integer NOT NULL,
771 longitude integer NOT NULL,
772 tile bigint NOT NULL,
773 updated_at timestamp without time zone NOT NULL,
774 created_at timestamp without time zone NOT NULL,
775 status note_status_enum NOT NULL,
776 closed_at timestamp without time zone
781 -- Name: notes_id_seq; Type: SEQUENCE; Schema: public; Owner: -
784 CREATE SEQUENCE notes_id_seq
793 -- Name: notes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
796 ALTER SEQUENCE notes_id_seq OWNED BY notes.id;
800 -- Name: oauth_nonces; Type: TABLE; Schema: public; Owner: -; Tablespace:
803 CREATE TABLE oauth_nonces (
805 nonce character varying(255),
807 created_at timestamp without time zone,
808 updated_at timestamp without time zone
813 -- Name: oauth_nonces_id_seq; Type: SEQUENCE; Schema: public; Owner: -
816 CREATE SEQUENCE oauth_nonces_id_seq
825 -- Name: oauth_nonces_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
828 ALTER SEQUENCE oauth_nonces_id_seq OWNED BY oauth_nonces.id;
832 -- Name: oauth_tokens; Type: TABLE; Schema: public; Owner: -; Tablespace:
835 CREATE TABLE oauth_tokens (
838 type character varying(20),
839 client_application_id integer,
840 token character varying(50),
841 secret character varying(50),
842 authorized_at timestamp without time zone,
843 invalidated_at timestamp without time zone,
844 created_at timestamp without time zone,
845 updated_at timestamp without time zone,
846 allow_read_prefs boolean DEFAULT false NOT NULL,
847 allow_write_prefs boolean DEFAULT false NOT NULL,
848 allow_write_diary boolean DEFAULT false NOT NULL,
849 allow_write_api boolean DEFAULT false NOT NULL,
850 allow_read_gpx boolean DEFAULT false NOT NULL,
851 allow_write_gpx boolean DEFAULT false NOT NULL,
852 callback_url character varying(255),
853 verifier character varying(20),
854 scope character varying(255),
855 valid_to timestamp without time zone,
856 allow_write_notes boolean DEFAULT false NOT NULL
861 -- Name: oauth_tokens_id_seq; Type: SEQUENCE; Schema: public; Owner: -
864 CREATE SEQUENCE oauth_tokens_id_seq
873 -- Name: oauth_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
876 ALTER SEQUENCE oauth_tokens_id_seq OWNED BY oauth_tokens.id;
880 -- Name: redactions; Type: TABLE; Schema: public; Owner: -; Tablespace:
883 CREATE TABLE redactions (
885 title character varying(255),
887 created_at timestamp without time zone NOT NULL,
888 updated_at timestamp without time zone NOT NULL,
889 user_id bigint NOT NULL,
890 description_format format_enum DEFAULT 'markdown'::format_enum NOT NULL
895 -- Name: redactions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
898 CREATE SEQUENCE redactions_id_seq
907 -- Name: redactions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
910 ALTER SEQUENCE redactions_id_seq OWNED BY redactions.id;
914 -- Name: relation_members; Type: TABLE; Schema: public; Owner: -; Tablespace:
917 CREATE TABLE relation_members (
918 relation_id bigint DEFAULT 0 NOT NULL,
919 member_type nwr_enum NOT NULL,
920 member_id bigint NOT NULL,
921 member_role character varying(255) NOT NULL,
922 version bigint DEFAULT 0 NOT NULL,
923 sequence_id integer DEFAULT 0 NOT NULL
928 -- Name: relation_tags; Type: TABLE; Schema: public; Owner: -; Tablespace:
931 CREATE TABLE relation_tags (
932 relation_id bigint DEFAULT 0 NOT NULL,
933 k character varying(255) DEFAULT ''::character varying NOT NULL,
934 v character varying(255) DEFAULT ''::character varying NOT NULL,
935 version bigint NOT NULL
940 -- Name: relations; Type: TABLE; Schema: public; Owner: -; Tablespace:
943 CREATE TABLE relations (
944 relation_id bigint DEFAULT 0 NOT NULL,
945 changeset_id bigint NOT NULL,
946 "timestamp" timestamp without time zone NOT NULL,
947 version bigint NOT NULL,
948 visible boolean DEFAULT true NOT NULL,
954 -- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -; Tablespace:
957 CREATE TABLE schema_migrations (
958 version character varying(255) NOT NULL
963 -- Name: user_blocks; Type: TABLE; Schema: public; Owner: -; Tablespace:
966 CREATE TABLE user_blocks (
968 user_id bigint NOT NULL,
969 creator_id bigint NOT NULL,
970 reason text NOT NULL,
971 ends_at timestamp without time zone NOT NULL,
972 needs_view boolean DEFAULT false NOT NULL,
974 created_at timestamp without time zone,
975 updated_at timestamp without time zone,
976 reason_format format_enum DEFAULT 'html'::format_enum NOT NULL
981 -- Name: user_blocks_id_seq; Type: SEQUENCE; Schema: public; Owner: -
984 CREATE SEQUENCE user_blocks_id_seq
993 -- Name: user_blocks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
996 ALTER SEQUENCE user_blocks_id_seq OWNED BY user_blocks.id;
1000 -- Name: user_preferences; Type: TABLE; Schema: public; Owner: -; Tablespace:
1003 CREATE TABLE user_preferences (
1004 user_id bigint NOT NULL,
1005 k character varying(255) NOT NULL,
1006 v character varying(255) NOT NULL
1011 -- Name: user_roles; Type: TABLE; Schema: public; Owner: -; Tablespace:
1014 CREATE TABLE user_roles (
1015 id integer NOT NULL,
1016 user_id bigint NOT NULL,
1017 created_at timestamp without time zone,
1018 updated_at timestamp without time zone,
1019 role user_role_enum NOT NULL,
1020 granter_id bigint NOT NULL
1025 -- Name: user_roles_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1028 CREATE SEQUENCE user_roles_id_seq
1037 -- Name: user_roles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1040 ALTER SEQUENCE user_roles_id_seq OWNED BY user_roles.id;
1044 -- Name: user_tokens; Type: TABLE; Schema: public; Owner: -; Tablespace:
1047 CREATE TABLE user_tokens (
1049 user_id bigint NOT NULL,
1050 token character varying(255) NOT NULL,
1051 expiry timestamp without time zone NOT NULL,
1057 -- Name: user_tokens_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1060 CREATE SEQUENCE user_tokens_id_seq
1069 -- Name: user_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1072 ALTER SEQUENCE user_tokens_id_seq OWNED BY user_tokens.id;
1076 -- Name: users; Type: TABLE; Schema: public; Owner: -; Tablespace:
1079 CREATE TABLE users (
1080 email character varying(255) NOT NULL,
1082 pass_crypt character varying(255) NOT NULL,
1083 creation_time timestamp without time zone NOT NULL,
1084 display_name character varying(255) DEFAULT ''::character varying NOT NULL,
1085 data_public boolean DEFAULT false NOT NULL,
1086 description text DEFAULT ''::text NOT NULL,
1087 home_lat double precision,
1088 home_lon double precision,
1089 home_zoom smallint DEFAULT 3,
1090 nearby integer DEFAULT 50,
1091 pass_salt character varying(255),
1092 image_file_name text,
1093 email_valid boolean DEFAULT false NOT NULL,
1094 new_email character varying(255),
1095 creation_ip character varying(255),
1096 languages character varying(255),
1097 status user_status_enum DEFAULT 'pending'::user_status_enum NOT NULL,
1098 terms_agreed timestamp without time zone,
1099 consider_pd boolean DEFAULT false NOT NULL,
1100 preferred_editor character varying(255),
1101 terms_seen boolean DEFAULT false NOT NULL,
1102 openid_url character varying(255),
1103 description_format format_enum DEFAULT 'html'::format_enum NOT NULL,
1104 image_fingerprint character varying(255),
1105 changesets_count integer DEFAULT 0 NOT NULL,
1106 traces_count integer DEFAULT 0 NOT NULL,
1107 diary_entries_count integer DEFAULT 0 NOT NULL,
1108 image_use_gravatar boolean DEFAULT true NOT NULL
1113 -- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1116 CREATE SEQUENCE users_id_seq
1125 -- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1128 ALTER SEQUENCE users_id_seq OWNED BY users.id;
1132 -- Name: way_nodes; Type: TABLE; Schema: public; Owner: -; Tablespace:
1135 CREATE TABLE way_nodes (
1136 way_id bigint NOT NULL,
1137 node_id bigint NOT NULL,
1138 version bigint NOT NULL,
1139 sequence_id bigint NOT NULL
1144 -- Name: way_tags; Type: TABLE; Schema: public; Owner: -; Tablespace:
1147 CREATE TABLE way_tags (
1148 way_id bigint DEFAULT 0 NOT NULL,
1149 k character varying(255) NOT NULL,
1150 v character varying(255) NOT NULL,
1151 version bigint NOT NULL
1156 -- Name: ways; Type: TABLE; Schema: public; Owner: -; Tablespace:
1160 way_id bigint DEFAULT 0 NOT NULL,
1161 changeset_id bigint NOT NULL,
1162 "timestamp" timestamp without time zone NOT NULL,
1163 version bigint NOT NULL,
1164 visible boolean DEFAULT true NOT NULL,
1165 redaction_id integer
1170 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1173 ALTER TABLE ONLY acls ALTER COLUMN id SET DEFAULT nextval('acls_id_seq'::regclass);
1177 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1180 ALTER TABLE ONLY changesets ALTER COLUMN id SET DEFAULT nextval('changesets_id_seq'::regclass);
1184 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1187 ALTER TABLE ONLY client_applications ALTER COLUMN id SET DEFAULT nextval('client_applications_id_seq'::regclass);
1191 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1194 ALTER TABLE ONLY countries ALTER COLUMN id SET DEFAULT nextval('countries_id_seq'::regclass);
1198 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1201 ALTER TABLE ONLY current_nodes ALTER COLUMN id SET DEFAULT nextval('current_nodes_id_seq'::regclass);
1205 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1208 ALTER TABLE ONLY current_relations ALTER COLUMN id SET DEFAULT nextval('current_relations_id_seq'::regclass);
1212 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1215 ALTER TABLE ONLY current_ways ALTER COLUMN id SET DEFAULT nextval('current_ways_id_seq'::regclass);
1219 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1222 ALTER TABLE ONLY diary_comments ALTER COLUMN id SET DEFAULT nextval('diary_comments_id_seq'::regclass);
1226 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1229 ALTER TABLE ONLY diary_entries ALTER COLUMN id SET DEFAULT nextval('diary_entries_id_seq'::regclass);
1233 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1236 ALTER TABLE ONLY friends ALTER COLUMN id SET DEFAULT nextval('friends_id_seq'::regclass);
1240 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1243 ALTER TABLE ONLY gpx_file_tags ALTER COLUMN id SET DEFAULT nextval('gpx_file_tags_id_seq'::regclass);
1247 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1250 ALTER TABLE ONLY gpx_files ALTER COLUMN id SET DEFAULT nextval('gpx_files_id_seq'::regclass);
1254 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1257 ALTER TABLE ONLY messages ALTER COLUMN id SET DEFAULT nextval('messages_id_seq'::regclass);
1261 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1264 ALTER TABLE ONLY note_comments ALTER COLUMN id SET DEFAULT nextval('note_comments_id_seq'::regclass);
1268 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1271 ALTER TABLE ONLY notes ALTER COLUMN id SET DEFAULT nextval('notes_id_seq'::regclass);
1275 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1278 ALTER TABLE ONLY oauth_nonces ALTER COLUMN id SET DEFAULT nextval('oauth_nonces_id_seq'::regclass);
1282 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1285 ALTER TABLE ONLY oauth_tokens ALTER COLUMN id SET DEFAULT nextval('oauth_tokens_id_seq'::regclass);
1289 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1292 ALTER TABLE ONLY redactions ALTER COLUMN id SET DEFAULT nextval('redactions_id_seq'::regclass);
1296 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1299 ALTER TABLE ONLY user_blocks ALTER COLUMN id SET DEFAULT nextval('user_blocks_id_seq'::regclass);
1303 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1306 ALTER TABLE ONLY user_roles ALTER COLUMN id SET DEFAULT nextval('user_roles_id_seq'::regclass);
1310 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1313 ALTER TABLE ONLY user_tokens ALTER COLUMN id SET DEFAULT nextval('user_tokens_id_seq'::regclass);
1317 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1320 ALTER TABLE ONLY users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass);
1324 -- Name: acls_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1327 ALTER TABLE ONLY acls
1328 ADD CONSTRAINT acls_pkey PRIMARY KEY (id);
1332 -- Name: changesets_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1335 ALTER TABLE ONLY changesets
1336 ADD CONSTRAINT changesets_pkey PRIMARY KEY (id);
1340 -- Name: client_applications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1343 ALTER TABLE ONLY client_applications
1344 ADD CONSTRAINT client_applications_pkey PRIMARY KEY (id);
1348 -- Name: countries_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1351 ALTER TABLE ONLY countries
1352 ADD CONSTRAINT countries_pkey PRIMARY KEY (id);
1356 -- Name: current_node_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1359 ALTER TABLE ONLY current_node_tags
1360 ADD CONSTRAINT current_node_tags_pkey PRIMARY KEY (node_id, k);
1364 -- Name: current_nodes_pkey1; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1367 ALTER TABLE ONLY current_nodes
1368 ADD CONSTRAINT current_nodes_pkey1 PRIMARY KEY (id);
1372 -- Name: current_relation_members_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1375 ALTER TABLE ONLY current_relation_members
1376 ADD CONSTRAINT current_relation_members_pkey PRIMARY KEY (relation_id, member_type, member_id, member_role, sequence_id);
1380 -- Name: current_relation_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1383 ALTER TABLE ONLY current_relation_tags
1384 ADD CONSTRAINT current_relation_tags_pkey PRIMARY KEY (relation_id, k);
1388 -- Name: current_relations_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1391 ALTER TABLE ONLY current_relations
1392 ADD CONSTRAINT current_relations_pkey PRIMARY KEY (id);
1396 -- Name: current_way_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1399 ALTER TABLE ONLY current_way_nodes
1400 ADD CONSTRAINT current_way_nodes_pkey PRIMARY KEY (way_id, sequence_id);
1404 -- Name: current_way_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1407 ALTER TABLE ONLY current_way_tags
1408 ADD CONSTRAINT current_way_tags_pkey PRIMARY KEY (way_id, k);
1412 -- Name: current_ways_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1415 ALTER TABLE ONLY current_ways
1416 ADD CONSTRAINT current_ways_pkey PRIMARY KEY (id);
1420 -- Name: diary_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1423 ALTER TABLE ONLY diary_comments
1424 ADD CONSTRAINT diary_comments_pkey PRIMARY KEY (id);
1428 -- Name: diary_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1431 ALTER TABLE ONLY diary_entries
1432 ADD CONSTRAINT diary_entries_pkey PRIMARY KEY (id);
1436 -- Name: friends_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1439 ALTER TABLE ONLY friends
1440 ADD CONSTRAINT friends_pkey PRIMARY KEY (id);
1444 -- Name: gpx_file_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1447 ALTER TABLE ONLY gpx_file_tags
1448 ADD CONSTRAINT gpx_file_tags_pkey PRIMARY KEY (id);
1452 -- Name: gpx_files_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1455 ALTER TABLE ONLY gpx_files
1456 ADD CONSTRAINT gpx_files_pkey PRIMARY KEY (id);
1460 -- Name: languages_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1463 ALTER TABLE ONLY languages
1464 ADD CONSTRAINT languages_pkey PRIMARY KEY (code);
1468 -- Name: messages_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1471 ALTER TABLE ONLY messages
1472 ADD CONSTRAINT messages_pkey PRIMARY KEY (id);
1476 -- Name: node_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1479 ALTER TABLE ONLY node_tags
1480 ADD CONSTRAINT node_tags_pkey PRIMARY KEY (node_id, version, k);
1484 -- Name: nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1487 ALTER TABLE ONLY nodes
1488 ADD CONSTRAINT nodes_pkey PRIMARY KEY (node_id, version);
1492 -- Name: note_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1495 ALTER TABLE ONLY note_comments
1496 ADD CONSTRAINT note_comments_pkey PRIMARY KEY (id);
1500 -- Name: notes_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1503 ALTER TABLE ONLY notes
1504 ADD CONSTRAINT notes_pkey PRIMARY KEY (id);
1508 -- Name: oauth_nonces_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1511 ALTER TABLE ONLY oauth_nonces
1512 ADD CONSTRAINT oauth_nonces_pkey PRIMARY KEY (id);
1516 -- Name: oauth_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1519 ALTER TABLE ONLY oauth_tokens
1520 ADD CONSTRAINT oauth_tokens_pkey PRIMARY KEY (id);
1524 -- Name: redactions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1527 ALTER TABLE ONLY redactions
1528 ADD CONSTRAINT redactions_pkey PRIMARY KEY (id);
1532 -- Name: relation_members_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1535 ALTER TABLE ONLY relation_members
1536 ADD CONSTRAINT relation_members_pkey PRIMARY KEY (relation_id, version, member_type, member_id, member_role, sequence_id);
1540 -- Name: relation_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1543 ALTER TABLE ONLY relation_tags
1544 ADD CONSTRAINT relation_tags_pkey PRIMARY KEY (relation_id, version, k);
1548 -- Name: relations_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1551 ALTER TABLE ONLY relations
1552 ADD CONSTRAINT relations_pkey PRIMARY KEY (relation_id, version);
1556 -- Name: user_blocks_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1559 ALTER TABLE ONLY user_blocks
1560 ADD CONSTRAINT user_blocks_pkey PRIMARY KEY (id);
1564 -- Name: user_preferences_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1567 ALTER TABLE ONLY user_preferences
1568 ADD CONSTRAINT user_preferences_pkey PRIMARY KEY (user_id, k);
1572 -- Name: user_roles_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1575 ALTER TABLE ONLY user_roles
1576 ADD CONSTRAINT user_roles_pkey PRIMARY KEY (id);
1580 -- Name: user_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1583 ALTER TABLE ONLY user_tokens
1584 ADD CONSTRAINT user_tokens_pkey PRIMARY KEY (id);
1588 -- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1591 ALTER TABLE ONLY users
1592 ADD CONSTRAINT users_pkey PRIMARY KEY (id);
1596 -- Name: way_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1599 ALTER TABLE ONLY way_nodes
1600 ADD CONSTRAINT way_nodes_pkey PRIMARY KEY (way_id, version, sequence_id);
1604 -- Name: way_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1607 ALTER TABLE ONLY way_tags
1608 ADD CONSTRAINT way_tags_pkey PRIMARY KEY (way_id, version, k);
1612 -- Name: ways_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1615 ALTER TABLE ONLY ways
1616 ADD CONSTRAINT ways_pkey PRIMARY KEY (way_id, version);
1620 -- Name: acls_k_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1623 CREATE INDEX acls_k_idx ON acls USING btree (k);
1627 -- Name: changeset_tags_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1630 CREATE INDEX changeset_tags_id_idx ON changeset_tags USING btree (changeset_id);
1634 -- Name: changesets_bbox_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1637 CREATE INDEX changesets_bbox_idx ON changesets USING gist (min_lat, max_lat, min_lon, max_lon);
1641 -- Name: changesets_closed_at_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1644 CREATE INDEX changesets_closed_at_idx ON changesets USING btree (closed_at);
1648 -- Name: changesets_created_at_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1651 CREATE INDEX changesets_created_at_idx ON changesets USING btree (created_at);
1655 -- Name: changesets_user_id_created_at_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1658 CREATE INDEX changesets_user_id_created_at_idx ON changesets USING btree (user_id, created_at);
1662 -- Name: changesets_user_id_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1665 CREATE INDEX changesets_user_id_id_idx ON changesets USING btree (user_id, id);
1669 -- Name: countries_code_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1672 CREATE UNIQUE INDEX countries_code_idx ON countries USING btree (code);
1676 -- Name: current_nodes_tile_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1679 CREATE INDEX current_nodes_tile_idx ON current_nodes USING btree (tile);
1683 -- Name: current_nodes_timestamp_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1686 CREATE INDEX current_nodes_timestamp_idx ON current_nodes USING btree ("timestamp");
1690 -- Name: current_relation_members_member_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1693 CREATE INDEX current_relation_members_member_idx ON current_relation_members USING btree (member_type, member_id);
1697 -- Name: current_relations_timestamp_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1700 CREATE INDEX current_relations_timestamp_idx ON current_relations USING btree ("timestamp");
1704 -- Name: current_way_nodes_node_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1707 CREATE INDEX current_way_nodes_node_idx ON current_way_nodes USING btree (node_id);
1711 -- Name: current_ways_timestamp_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1714 CREATE INDEX current_ways_timestamp_idx ON current_ways USING btree ("timestamp");
1718 -- Name: diary_comment_user_id_created_at_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
1721 CREATE INDEX diary_comment_user_id_created_at_index ON diary_comments USING btree (user_id, created_at);
1725 -- Name: diary_comments_entry_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1728 CREATE UNIQUE INDEX diary_comments_entry_id_idx ON diary_comments USING btree (diary_entry_id, id);
1732 -- Name: diary_entry_created_at_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
1735 CREATE INDEX diary_entry_created_at_index ON diary_entries USING btree (created_at);
1739 -- Name: diary_entry_language_code_created_at_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
1742 CREATE INDEX diary_entry_language_code_created_at_index ON diary_entries USING btree (language_code, created_at);
1746 -- Name: diary_entry_user_id_created_at_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
1749 CREATE INDEX diary_entry_user_id_created_at_index ON diary_entries USING btree (user_id, created_at);
1753 -- Name: friends_user_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1756 CREATE INDEX friends_user_id_idx ON friends USING btree (user_id);
1760 -- Name: gpx_file_tags_gpxid_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1763 CREATE INDEX gpx_file_tags_gpxid_idx ON gpx_file_tags USING btree (gpx_id);
1767 -- Name: gpx_file_tags_tag_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1770 CREATE INDEX gpx_file_tags_tag_idx ON gpx_file_tags USING btree (tag);
1774 -- Name: gpx_files_timestamp_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1777 CREATE INDEX gpx_files_timestamp_idx ON gpx_files USING btree ("timestamp");
1781 -- Name: gpx_files_user_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1784 CREATE INDEX gpx_files_user_id_idx ON gpx_files USING btree (user_id);
1788 -- Name: gpx_files_visible_visibility_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1791 CREATE INDEX gpx_files_visible_visibility_idx ON gpx_files USING btree (visible, visibility);
1795 -- Name: index_client_applications_on_key; Type: INDEX; Schema: public; Owner: -; Tablespace:
1798 CREATE UNIQUE INDEX index_client_applications_on_key ON client_applications USING btree (key);
1802 -- Name: index_note_comments_on_body; Type: INDEX; Schema: public; Owner: -; Tablespace:
1805 CREATE INDEX index_note_comments_on_body ON note_comments USING gin (to_tsvector('english'::regconfig, body));
1809 -- Name: index_note_comments_on_created_at; Type: INDEX; Schema: public; Owner: -; Tablespace:
1812 CREATE INDEX index_note_comments_on_created_at ON note_comments USING btree (created_at);
1816 -- Name: index_oauth_nonces_on_nonce_and_timestamp; Type: INDEX; Schema: public; Owner: -; Tablespace:
1819 CREATE UNIQUE INDEX index_oauth_nonces_on_nonce_and_timestamp ON oauth_nonces USING btree (nonce, "timestamp");
1823 -- Name: index_oauth_tokens_on_token; Type: INDEX; Schema: public; Owner: -; Tablespace:
1826 CREATE UNIQUE INDEX index_oauth_tokens_on_token ON oauth_tokens USING btree (token);
1830 -- Name: index_user_blocks_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
1833 CREATE INDEX index_user_blocks_on_user_id ON user_blocks USING btree (user_id);
1837 -- Name: messages_from_user_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1840 CREATE INDEX messages_from_user_id_idx ON messages USING btree (from_user_id);
1844 -- Name: messages_to_user_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1847 CREATE INDEX messages_to_user_id_idx ON messages USING btree (to_user_id);
1851 -- Name: nodes_changeset_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1854 CREATE INDEX nodes_changeset_id_idx ON nodes USING btree (changeset_id);
1858 -- Name: nodes_tile_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1861 CREATE INDEX nodes_tile_idx ON nodes USING btree (tile);
1865 -- Name: nodes_timestamp_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1868 CREATE INDEX nodes_timestamp_idx ON nodes USING btree ("timestamp");
1872 -- Name: note_comments_note_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1875 CREATE INDEX note_comments_note_id_idx ON note_comments USING btree (note_id);
1879 -- Name: notes_created_at_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1882 CREATE INDEX notes_created_at_idx ON notes USING btree (created_at);
1886 -- Name: notes_tile_status_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1889 CREATE INDEX notes_tile_status_idx ON notes USING btree (tile, status);
1893 -- Name: notes_updated_at_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1896 CREATE INDEX notes_updated_at_idx ON notes USING btree (updated_at);
1900 -- Name: points_gpxid_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1903 CREATE INDEX points_gpxid_idx ON gps_points USING btree (gpx_id);
1907 -- Name: points_tile_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1910 CREATE INDEX points_tile_idx ON gps_points USING btree (tile);
1914 -- Name: relation_members_member_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1917 CREATE INDEX relation_members_member_idx ON relation_members USING btree (member_type, member_id);
1921 -- Name: relations_changeset_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1924 CREATE INDEX relations_changeset_id_idx ON relations USING btree (changeset_id);
1928 -- Name: relations_timestamp_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1931 CREATE INDEX relations_timestamp_idx ON relations USING btree ("timestamp");
1935 -- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -; Tablespace:
1938 CREATE UNIQUE INDEX unique_schema_migrations ON schema_migrations USING btree (version);
1942 -- Name: user_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1945 CREATE INDEX user_id_idx ON friends USING btree (friend_user_id);
1949 -- Name: user_openid_url_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1952 CREATE UNIQUE INDEX user_openid_url_idx ON users USING btree (openid_url);
1956 -- Name: user_roles_id_role_unique; Type: INDEX; Schema: public; Owner: -; Tablespace:
1959 CREATE UNIQUE INDEX user_roles_id_role_unique ON user_roles USING btree (user_id, role);
1963 -- Name: user_tokens_token_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1966 CREATE UNIQUE INDEX user_tokens_token_idx ON user_tokens USING btree (token);
1970 -- Name: user_tokens_user_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1973 CREATE INDEX user_tokens_user_id_idx ON user_tokens USING btree (user_id);
1977 -- Name: users_display_name_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1980 CREATE UNIQUE INDEX users_display_name_idx ON users USING btree (display_name);
1984 -- Name: users_display_name_lower_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1987 CREATE INDEX users_display_name_lower_idx ON users USING btree (lower((display_name)::text));
1991 -- Name: users_email_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1994 CREATE UNIQUE INDEX users_email_idx ON users USING btree (email);
1998 -- Name: users_email_lower_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
2001 CREATE INDEX users_email_lower_idx ON users USING btree (lower((email)::text));
2005 -- Name: way_nodes_node_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
2008 CREATE INDEX way_nodes_node_idx ON way_nodes USING btree (node_id);
2012 -- Name: ways_changeset_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
2015 CREATE INDEX ways_changeset_id_idx ON ways USING btree (changeset_id);
2019 -- Name: ways_timestamp_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
2022 CREATE INDEX ways_timestamp_idx ON ways USING btree ("timestamp");
2026 -- Name: changeset_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2029 ALTER TABLE ONLY changeset_tags
2030 ADD CONSTRAINT changeset_tags_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2034 -- Name: changesets_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2037 ALTER TABLE ONLY changesets
2038 ADD CONSTRAINT changesets_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2042 -- Name: client_applications_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2045 ALTER TABLE ONLY client_applications
2046 ADD CONSTRAINT client_applications_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2050 -- Name: current_node_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2053 ALTER TABLE ONLY current_node_tags
2054 ADD CONSTRAINT current_node_tags_id_fkey FOREIGN KEY (node_id) REFERENCES current_nodes(id);
2058 -- Name: current_nodes_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2061 ALTER TABLE ONLY current_nodes
2062 ADD CONSTRAINT current_nodes_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2066 -- Name: current_relation_members_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2069 ALTER TABLE ONLY current_relation_members
2070 ADD CONSTRAINT current_relation_members_id_fkey FOREIGN KEY (relation_id) REFERENCES current_relations(id);
2074 -- Name: current_relation_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2077 ALTER TABLE ONLY current_relation_tags
2078 ADD CONSTRAINT current_relation_tags_id_fkey FOREIGN KEY (relation_id) REFERENCES current_relations(id);
2082 -- Name: current_relations_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2085 ALTER TABLE ONLY current_relations
2086 ADD CONSTRAINT current_relations_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2090 -- Name: current_way_nodes_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2093 ALTER TABLE ONLY current_way_nodes
2094 ADD CONSTRAINT current_way_nodes_id_fkey FOREIGN KEY (way_id) REFERENCES current_ways(id);
2098 -- Name: current_way_nodes_node_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2101 ALTER TABLE ONLY current_way_nodes
2102 ADD CONSTRAINT current_way_nodes_node_id_fkey FOREIGN KEY (node_id) REFERENCES current_nodes(id);
2106 -- Name: current_way_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2109 ALTER TABLE ONLY current_way_tags
2110 ADD CONSTRAINT current_way_tags_id_fkey FOREIGN KEY (way_id) REFERENCES current_ways(id);
2114 -- Name: current_ways_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2117 ALTER TABLE ONLY current_ways
2118 ADD CONSTRAINT current_ways_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2122 -- Name: diary_comments_diary_entry_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2125 ALTER TABLE ONLY diary_comments
2126 ADD CONSTRAINT diary_comments_diary_entry_id_fkey FOREIGN KEY (diary_entry_id) REFERENCES diary_entries(id);
2130 -- Name: diary_comments_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2133 ALTER TABLE ONLY diary_comments
2134 ADD CONSTRAINT diary_comments_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2138 -- Name: diary_entries_language_code_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2141 ALTER TABLE ONLY diary_entries
2142 ADD CONSTRAINT diary_entries_language_code_fkey FOREIGN KEY (language_code) REFERENCES languages(code);
2146 -- Name: diary_entries_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2149 ALTER TABLE ONLY diary_entries
2150 ADD CONSTRAINT diary_entries_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2154 -- Name: friends_friend_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2157 ALTER TABLE ONLY friends
2158 ADD CONSTRAINT friends_friend_user_id_fkey FOREIGN KEY (friend_user_id) REFERENCES users(id);
2162 -- Name: friends_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2165 ALTER TABLE ONLY friends
2166 ADD CONSTRAINT friends_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2170 -- Name: gps_points_gpx_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2173 ALTER TABLE ONLY gps_points
2174 ADD CONSTRAINT gps_points_gpx_id_fkey FOREIGN KEY (gpx_id) REFERENCES gpx_files(id);
2178 -- Name: gpx_file_tags_gpx_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2181 ALTER TABLE ONLY gpx_file_tags
2182 ADD CONSTRAINT gpx_file_tags_gpx_id_fkey FOREIGN KEY (gpx_id) REFERENCES gpx_files(id);
2186 -- Name: gpx_files_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2189 ALTER TABLE ONLY gpx_files
2190 ADD CONSTRAINT gpx_files_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2194 -- Name: messages_from_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2197 ALTER TABLE ONLY messages
2198 ADD CONSTRAINT messages_from_user_id_fkey FOREIGN KEY (from_user_id) REFERENCES users(id);
2202 -- Name: messages_to_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2205 ALTER TABLE ONLY messages
2206 ADD CONSTRAINT messages_to_user_id_fkey FOREIGN KEY (to_user_id) REFERENCES users(id);
2210 -- Name: node_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2213 ALTER TABLE ONLY node_tags
2214 ADD CONSTRAINT node_tags_id_fkey FOREIGN KEY (node_id, version) REFERENCES nodes(node_id, version);
2218 -- Name: nodes_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2221 ALTER TABLE ONLY nodes
2222 ADD CONSTRAINT nodes_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2226 -- Name: nodes_redaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2229 ALTER TABLE ONLY nodes
2230 ADD CONSTRAINT nodes_redaction_id_fkey FOREIGN KEY (redaction_id) REFERENCES redactions(id);
2234 -- Name: note_comments_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2237 ALTER TABLE ONLY note_comments
2238 ADD CONSTRAINT note_comments_author_id_fkey FOREIGN KEY (author_id) REFERENCES users(id);
2242 -- Name: note_comments_note_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2245 ALTER TABLE ONLY note_comments
2246 ADD CONSTRAINT note_comments_note_id_fkey FOREIGN KEY (note_id) REFERENCES notes(id);
2250 -- Name: oauth_tokens_client_application_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2253 ALTER TABLE ONLY oauth_tokens
2254 ADD CONSTRAINT oauth_tokens_client_application_id_fkey FOREIGN KEY (client_application_id) REFERENCES client_applications(id);
2258 -- Name: oauth_tokens_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2261 ALTER TABLE ONLY oauth_tokens
2262 ADD CONSTRAINT oauth_tokens_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2266 -- Name: redactions_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2269 ALTER TABLE ONLY redactions
2270 ADD CONSTRAINT redactions_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2274 -- Name: relation_members_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2277 ALTER TABLE ONLY relation_members
2278 ADD CONSTRAINT relation_members_id_fkey FOREIGN KEY (relation_id, version) REFERENCES relations(relation_id, version);
2282 -- Name: relation_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2285 ALTER TABLE ONLY relation_tags
2286 ADD CONSTRAINT relation_tags_id_fkey FOREIGN KEY (relation_id, version) REFERENCES relations(relation_id, version);
2290 -- Name: relations_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2293 ALTER TABLE ONLY relations
2294 ADD CONSTRAINT relations_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2298 -- Name: relations_redaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2301 ALTER TABLE ONLY relations
2302 ADD CONSTRAINT relations_redaction_id_fkey FOREIGN KEY (redaction_id) REFERENCES redactions(id);
2306 -- Name: user_blocks_moderator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2309 ALTER TABLE ONLY user_blocks
2310 ADD CONSTRAINT user_blocks_moderator_id_fkey FOREIGN KEY (creator_id) REFERENCES users(id);
2314 -- Name: user_blocks_revoker_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2317 ALTER TABLE ONLY user_blocks
2318 ADD CONSTRAINT user_blocks_revoker_id_fkey FOREIGN KEY (revoker_id) REFERENCES users(id);
2322 -- Name: user_blocks_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2325 ALTER TABLE ONLY user_blocks
2326 ADD CONSTRAINT user_blocks_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2330 -- Name: user_preferences_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2333 ALTER TABLE ONLY user_preferences
2334 ADD CONSTRAINT user_preferences_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2338 -- Name: user_roles_granter_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2341 ALTER TABLE ONLY user_roles
2342 ADD CONSTRAINT user_roles_granter_id_fkey FOREIGN KEY (granter_id) REFERENCES users(id);
2346 -- Name: user_roles_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2349 ALTER TABLE ONLY user_roles
2350 ADD CONSTRAINT user_roles_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2354 -- Name: user_tokens_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2357 ALTER TABLE ONLY user_tokens
2358 ADD CONSTRAINT user_tokens_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2362 -- Name: way_nodes_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2365 ALTER TABLE ONLY way_nodes
2366 ADD CONSTRAINT way_nodes_id_fkey FOREIGN KEY (way_id, version) REFERENCES ways(way_id, version);
2370 -- Name: way_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2373 ALTER TABLE ONLY way_tags
2374 ADD CONSTRAINT way_tags_id_fkey FOREIGN KEY (way_id, version) REFERENCES ways(way_id, version);
2378 -- Name: ways_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2381 ALTER TABLE ONLY ways
2382 ADD CONSTRAINT ways_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2386 -- Name: ways_redaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2389 ALTER TABLE ONLY ways
2390 ADD CONSTRAINT ways_redaction_id_fkey FOREIGN KEY (redaction_id) REFERENCES redactions(id);
2394 -- PostgreSQL database dump complete
2397 SET search_path TO "$user",public;
2399 INSERT INTO schema_migrations (version) VALUES ('1');
2401 INSERT INTO schema_migrations (version) VALUES ('10');
2403 INSERT INTO schema_migrations (version) VALUES ('11');
2405 INSERT INTO schema_migrations (version) VALUES ('12');
2407 INSERT INTO schema_migrations (version) VALUES ('13');
2409 INSERT INTO schema_migrations (version) VALUES ('14');
2411 INSERT INTO schema_migrations (version) VALUES ('15');
2413 INSERT INTO schema_migrations (version) VALUES ('16');
2415 INSERT INTO schema_migrations (version) VALUES ('17');
2417 INSERT INTO schema_migrations (version) VALUES ('18');
2419 INSERT INTO schema_migrations (version) VALUES ('19');
2421 INSERT INTO schema_migrations (version) VALUES ('2');
2423 INSERT INTO schema_migrations (version) VALUES ('20');
2425 INSERT INTO schema_migrations (version) VALUES ('20100513171259');
2427 INSERT INTO schema_migrations (version) VALUES ('20100516124737');
2429 INSERT INTO schema_migrations (version) VALUES ('20100910084426');
2431 INSERT INTO schema_migrations (version) VALUES ('20101114011429');
2433 INSERT INTO schema_migrations (version) VALUES ('20110322001319');
2435 INSERT INTO schema_migrations (version) VALUES ('20110508145337');
2437 INSERT INTO schema_migrations (version) VALUES ('20110521142405');
2439 INSERT INTO schema_migrations (version) VALUES ('20110925112722');
2441 INSERT INTO schema_migrations (version) VALUES ('20111116184519');
2443 INSERT INTO schema_migrations (version) VALUES ('20111212183945');
2445 INSERT INTO schema_migrations (version) VALUES ('20120123184321');
2447 INSERT INTO schema_migrations (version) VALUES ('20120208122334');
2449 INSERT INTO schema_migrations (version) VALUES ('20120208194454');
2451 INSERT INTO schema_migrations (version) VALUES ('20120214210114');
2453 INSERT INTO schema_migrations (version) VALUES ('20120219161649');
2455 INSERT INTO schema_migrations (version) VALUES ('20120318201948');
2457 INSERT INTO schema_migrations (version) VALUES ('20120328090602');
2459 INSERT INTO schema_migrations (version) VALUES ('20120404205604');
2461 INSERT INTO schema_migrations (version) VALUES ('20120808231205');
2463 INSERT INTO schema_migrations (version) VALUES ('20121005195010');
2465 INSERT INTO schema_migrations (version) VALUES ('20121012044047');
2467 INSERT INTO schema_migrations (version) VALUES ('20121119165817');
2469 INSERT INTO schema_migrations (version) VALUES ('20121202155309');
2471 INSERT INTO schema_migrations (version) VALUES ('20121203124841');
2473 INSERT INTO schema_migrations (version) VALUES ('20130328184137');
2475 INSERT INTO schema_migrations (version) VALUES ('20131212124700');
2477 INSERT INTO schema_migrations (version) VALUES ('20140115192822');
2479 INSERT INTO schema_migrations (version) VALUES ('21');
2481 INSERT INTO schema_migrations (version) VALUES ('22');
2483 INSERT INTO schema_migrations (version) VALUES ('23');
2485 INSERT INTO schema_migrations (version) VALUES ('24');
2487 INSERT INTO schema_migrations (version) VALUES ('25');
2489 INSERT INTO schema_migrations (version) VALUES ('26');
2491 INSERT INTO schema_migrations (version) VALUES ('27');
2493 INSERT INTO schema_migrations (version) VALUES ('28');
2495 INSERT INTO schema_migrations (version) VALUES ('29');
2497 INSERT INTO schema_migrations (version) VALUES ('3');
2499 INSERT INTO schema_migrations (version) VALUES ('30');
2501 INSERT INTO schema_migrations (version) VALUES ('31');
2503 INSERT INTO schema_migrations (version) VALUES ('32');
2505 INSERT INTO schema_migrations (version) VALUES ('33');
2507 INSERT INTO schema_migrations (version) VALUES ('34');
2509 INSERT INTO schema_migrations (version) VALUES ('35');
2511 INSERT INTO schema_migrations (version) VALUES ('36');
2513 INSERT INTO schema_migrations (version) VALUES ('37');
2515 INSERT INTO schema_migrations (version) VALUES ('38');
2517 INSERT INTO schema_migrations (version) VALUES ('39');
2519 INSERT INTO schema_migrations (version) VALUES ('4');
2521 INSERT INTO schema_migrations (version) VALUES ('40');
2523 INSERT INTO schema_migrations (version) VALUES ('41');
2525 INSERT INTO schema_migrations (version) VALUES ('42');
2527 INSERT INTO schema_migrations (version) VALUES ('43');
2529 INSERT INTO schema_migrations (version) VALUES ('44');
2531 INSERT INTO schema_migrations (version) VALUES ('45');
2533 INSERT INTO schema_migrations (version) VALUES ('46');
2535 INSERT INTO schema_migrations (version) VALUES ('47');
2537 INSERT INTO schema_migrations (version) VALUES ('48');
2539 INSERT INTO schema_migrations (version) VALUES ('49');
2541 INSERT INTO schema_migrations (version) VALUES ('5');
2543 INSERT INTO schema_migrations (version) VALUES ('50');
2545 INSERT INTO schema_migrations (version) VALUES ('51');
2547 INSERT INTO schema_migrations (version) VALUES ('52');
2549 INSERT INTO schema_migrations (version) VALUES ('53');
2551 INSERT INTO schema_migrations (version) VALUES ('54');
2553 INSERT INTO schema_migrations (version) VALUES ('55');
2555 INSERT INTO schema_migrations (version) VALUES ('56');
2557 INSERT INTO schema_migrations (version) VALUES ('57');
2559 INSERT INTO schema_migrations (version) VALUES ('6');
2561 INSERT INTO schema_migrations (version) VALUES ('7');
2563 INSERT INTO schema_migrations (version) VALUES ('8');
2565 INSERT INTO schema_migrations (version) VALUES ('9');