2 -- PostgreSQL database dump
5 SET statement_timeout = 0;
6 SET client_encoding = 'UTF8';
7 SET standard_conforming_strings = on;
8 SET check_function_bodies = false;
9 SET client_min_messages = warning;
12 -- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
15 CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
19 -- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
22 COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
26 -- Name: btree_gist; Type: EXTENSION; Schema: -; Owner: -
29 CREATE EXTENSION IF NOT EXISTS btree_gist WITH SCHEMA public;
33 -- Name: EXTENSION btree_gist; Type: COMMENT; Schema: -; Owner: -
36 COMMENT ON EXTENSION btree_gist IS 'support for indexing common datatypes in GiST';
39 SET search_path = public, pg_catalog;
42 -- Name: format_enum; Type: TYPE; Schema: public; Owner: -
45 CREATE TYPE format_enum AS ENUM (
52 -- Name: gpx_visibility_enum; Type: TYPE; Schema: public; Owner: -
55 CREATE TYPE gpx_visibility_enum AS ENUM (
64 -- Name: nwr_enum; Type: TYPE; Schema: public; Owner: -
67 CREATE TYPE nwr_enum AS ENUM (
75 -- Name: user_role_enum; Type: TYPE; Schema: public; Owner: -
78 CREATE TYPE user_role_enum AS ENUM (
85 -- Name: user_status_enum; Type: TYPE; Schema: public; Owner: -
88 CREATE TYPE user_status_enum AS ENUM (
98 -- Name: maptile_for_point(bigint, bigint, integer); Type: FUNCTION; Schema: public; Owner: -
101 CREATE FUNCTION maptile_for_point(bigint, bigint, integer) RETURNS integer
103 AS '/srv/www/master.osm.compton.nu/db/functions/libpgosm.so', 'maptile_for_point';
107 -- Name: tile_for_point(integer, integer); Type: FUNCTION; Schema: public; Owner: -
110 CREATE FUNCTION tile_for_point(integer, integer) RETURNS bigint
112 AS '/srv/www/master.osm.compton.nu/db/functions/libpgosm.so', 'tile_for_point';
116 -- Name: xid_to_int4(xid); Type: FUNCTION; Schema: public; Owner: -
119 CREATE FUNCTION xid_to_int4(xid) RETURNS integer
120 LANGUAGE c IMMUTABLE STRICT
121 AS '/srv/www/master.osm.compton.nu/db/functions/libpgosm.so', 'xid_to_int4';
124 SET default_tablespace = '';
126 SET default_with_oids = false;
129 -- Name: acls; Type: TABLE; Schema: public; Owner: -; Tablespace:
135 k character varying(255) NOT NULL,
136 v character varying(255),
137 domain character varying(255)
142 -- Name: acls_id_seq; Type: SEQUENCE; Schema: public; Owner: -
145 CREATE SEQUENCE acls_id_seq
154 -- Name: acls_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
157 ALTER SEQUENCE acls_id_seq OWNED BY acls.id;
161 -- Name: changeset_tags; Type: TABLE; Schema: public; Owner: -; Tablespace:
164 CREATE TABLE changeset_tags (
165 changeset_id bigint NOT NULL,
166 k character varying(255) DEFAULT ''::character varying NOT NULL,
167 v character varying(255) DEFAULT ''::character varying NOT NULL
172 -- Name: changesets; Type: TABLE; Schema: public; Owner: -; Tablespace:
175 CREATE TABLE changesets (
177 user_id bigint NOT NULL,
178 created_at timestamp without time zone NOT NULL,
183 closed_at timestamp without time zone NOT NULL,
184 num_changes integer DEFAULT 0 NOT NULL
189 -- Name: changesets_id_seq; Type: SEQUENCE; Schema: public; Owner: -
192 CREATE SEQUENCE changesets_id_seq
201 -- Name: changesets_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
204 ALTER SEQUENCE changesets_id_seq OWNED BY changesets.id;
208 -- Name: client_applications; Type: TABLE; Schema: public; Owner: -; Tablespace:
211 CREATE TABLE client_applications (
213 name character varying(255),
214 url character varying(255),
215 support_url character varying(255),
216 callback_url character varying(255),
217 key character varying(50),
218 secret character varying(50),
220 created_at timestamp without time zone,
221 updated_at timestamp without time zone,
222 allow_read_prefs boolean DEFAULT false NOT NULL,
223 allow_write_prefs boolean DEFAULT false NOT NULL,
224 allow_write_diary boolean DEFAULT false NOT NULL,
225 allow_write_api boolean DEFAULT false NOT NULL,
226 allow_read_gpx boolean DEFAULT false NOT NULL,
227 allow_write_gpx boolean DEFAULT false NOT NULL
232 -- Name: client_applications_id_seq; Type: SEQUENCE; Schema: public; Owner: -
235 CREATE SEQUENCE client_applications_id_seq
244 -- Name: client_applications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
247 ALTER SEQUENCE client_applications_id_seq OWNED BY client_applications.id;
251 -- Name: countries; Type: TABLE; Schema: public; Owner: -; Tablespace:
254 CREATE TABLE countries (
256 code character varying(2) NOT NULL,
257 min_lat double precision NOT NULL,
258 max_lat double precision NOT NULL,
259 min_lon double precision NOT NULL,
260 max_lon double precision NOT NULL
265 -- Name: countries_id_seq; Type: SEQUENCE; Schema: public; Owner: -
268 CREATE SEQUENCE countries_id_seq
277 -- Name: countries_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
280 ALTER SEQUENCE countries_id_seq OWNED BY countries.id;
284 -- Name: current_node_tags; Type: TABLE; Schema: public; Owner: -; Tablespace:
287 CREATE TABLE current_node_tags (
288 node_id bigint NOT NULL,
289 k character varying(255) DEFAULT ''::character varying NOT NULL,
290 v character varying(255) DEFAULT ''::character varying NOT NULL
295 -- Name: current_nodes; Type: TABLE; Schema: public; Owner: -; Tablespace:
298 CREATE TABLE current_nodes (
300 latitude integer NOT NULL,
301 longitude integer NOT NULL,
302 changeset_id bigint NOT NULL,
303 visible boolean NOT NULL,
304 "timestamp" timestamp without time zone NOT NULL,
305 tile bigint NOT NULL,
306 version bigint NOT NULL
311 -- Name: current_nodes_id_seq; Type: SEQUENCE; Schema: public; Owner: -
314 CREATE SEQUENCE current_nodes_id_seq
323 -- Name: current_nodes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
326 ALTER SEQUENCE current_nodes_id_seq OWNED BY current_nodes.id;
330 -- Name: current_relation_members; Type: TABLE; Schema: public; Owner: -; Tablespace:
333 CREATE TABLE current_relation_members (
334 relation_id bigint NOT NULL,
335 member_type nwr_enum NOT NULL,
336 member_id bigint NOT NULL,
337 member_role character varying(255) NOT NULL,
338 sequence_id integer DEFAULT 0 NOT NULL
343 -- Name: current_relation_tags; Type: TABLE; Schema: public; Owner: -; Tablespace:
346 CREATE TABLE current_relation_tags (
347 relation_id bigint NOT NULL,
348 k character varying(255) DEFAULT ''::character varying NOT NULL,
349 v character varying(255) DEFAULT ''::character varying NOT NULL
354 -- Name: current_relations; Type: TABLE; Schema: public; Owner: -; Tablespace:
357 CREATE TABLE current_relations (
359 changeset_id bigint NOT NULL,
360 "timestamp" timestamp without time zone NOT NULL,
361 visible boolean NOT NULL,
362 version bigint NOT NULL
367 -- Name: current_relations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
370 CREATE SEQUENCE current_relations_id_seq
379 -- Name: current_relations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
382 ALTER SEQUENCE current_relations_id_seq OWNED BY current_relations.id;
386 -- Name: current_way_nodes; Type: TABLE; Schema: public; Owner: -; Tablespace:
389 CREATE TABLE current_way_nodes (
390 way_id bigint NOT NULL,
391 node_id bigint NOT NULL,
392 sequence_id bigint NOT NULL
397 -- Name: current_way_tags; Type: TABLE; Schema: public; Owner: -; Tablespace:
400 CREATE TABLE current_way_tags (
401 way_id bigint NOT NULL,
402 k character varying(255) DEFAULT ''::character varying NOT NULL,
403 v character varying(255) DEFAULT ''::character varying NOT NULL
408 -- Name: current_ways; Type: TABLE; Schema: public; Owner: -; Tablespace:
411 CREATE TABLE current_ways (
413 changeset_id bigint NOT NULL,
414 "timestamp" timestamp without time zone NOT NULL,
415 visible boolean NOT NULL,
416 version bigint NOT NULL
421 -- Name: current_ways_id_seq; Type: SEQUENCE; Schema: public; Owner: -
424 CREATE SEQUENCE current_ways_id_seq
433 -- Name: current_ways_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
436 ALTER SEQUENCE current_ways_id_seq OWNED BY current_ways.id;
440 -- Name: diary_comments; Type: TABLE; Schema: public; Owner: -; Tablespace:
443 CREATE TABLE diary_comments (
445 diary_entry_id bigint NOT NULL,
446 user_id bigint NOT NULL,
448 created_at timestamp without time zone NOT NULL,
449 updated_at timestamp without time zone NOT NULL,
450 visible boolean DEFAULT true NOT NULL
455 -- Name: diary_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
458 CREATE SEQUENCE diary_comments_id_seq
467 -- Name: diary_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
470 ALTER SEQUENCE diary_comments_id_seq OWNED BY diary_comments.id;
474 -- Name: diary_entries; Type: TABLE; Schema: public; Owner: -; Tablespace:
477 CREATE TABLE diary_entries (
479 user_id bigint NOT NULL,
480 title character varying(255) NOT NULL,
482 created_at timestamp without time zone NOT NULL,
483 updated_at timestamp without time zone NOT NULL,
484 latitude double precision,
485 longitude double precision,
486 language_code character varying(255) DEFAULT 'en'::character varying NOT NULL,
487 visible boolean DEFAULT true NOT NULL
492 -- Name: diary_entries_id_seq; Type: SEQUENCE; Schema: public; Owner: -
495 CREATE SEQUENCE diary_entries_id_seq
504 -- Name: diary_entries_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
507 ALTER SEQUENCE diary_entries_id_seq OWNED BY diary_entries.id;
511 -- Name: friends; Type: TABLE; Schema: public; Owner: -; Tablespace:
514 CREATE TABLE friends (
516 user_id bigint NOT NULL,
517 friend_user_id bigint NOT NULL
522 -- Name: friends_id_seq; Type: SEQUENCE; Schema: public; Owner: -
525 CREATE SEQUENCE friends_id_seq
534 -- Name: friends_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
537 ALTER SEQUENCE friends_id_seq OWNED BY friends.id;
541 -- Name: gps_points; Type: TABLE; Schema: public; Owner: -; Tablespace:
544 CREATE TABLE gps_points (
545 altitude double precision,
546 trackid integer NOT NULL,
547 latitude integer NOT NULL,
548 longitude integer NOT NULL,
549 gpx_id bigint NOT NULL,
550 "timestamp" timestamp without time zone,
556 -- Name: gpx_file_tags; Type: TABLE; Schema: public; Owner: -; Tablespace:
559 CREATE TABLE gpx_file_tags (
560 gpx_id bigint DEFAULT 0 NOT NULL,
561 tag character varying(255) NOT NULL,
567 -- Name: gpx_file_tags_id_seq; Type: SEQUENCE; Schema: public; Owner: -
570 CREATE SEQUENCE gpx_file_tags_id_seq
579 -- Name: gpx_file_tags_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
582 ALTER SEQUENCE gpx_file_tags_id_seq OWNED BY gpx_file_tags.id;
586 -- Name: gpx_files; Type: TABLE; Schema: public; Owner: -; Tablespace:
589 CREATE TABLE gpx_files (
591 user_id bigint NOT NULL,
592 visible boolean DEFAULT true NOT NULL,
593 name character varying(255) DEFAULT ''::character varying NOT NULL,
595 latitude double precision,
596 longitude double precision,
597 "timestamp" timestamp without time zone NOT NULL,
598 description character varying(255) DEFAULT ''::character varying NOT NULL,
599 inserted boolean NOT NULL,
600 visibility gpx_visibility_enum DEFAULT 'public'::gpx_visibility_enum NOT NULL
605 -- Name: gpx_files_id_seq; Type: SEQUENCE; Schema: public; Owner: -
608 CREATE SEQUENCE gpx_files_id_seq
617 -- Name: gpx_files_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
620 ALTER SEQUENCE gpx_files_id_seq OWNED BY gpx_files.id;
624 -- Name: languages; Type: TABLE; Schema: public; Owner: -; Tablespace:
627 CREATE TABLE languages (
628 code character varying(255) NOT NULL,
629 english_name character varying(255) NOT NULL,
630 native_name character varying(255)
635 -- Name: messages; Type: TABLE; Schema: public; Owner: -; Tablespace:
638 CREATE TABLE messages (
640 from_user_id bigint NOT NULL,
641 title character varying(255) NOT NULL,
643 sent_on timestamp without time zone NOT NULL,
644 message_read boolean DEFAULT false NOT NULL,
645 to_user_id bigint NOT NULL,
646 to_user_visible boolean DEFAULT true NOT NULL,
647 from_user_visible boolean DEFAULT true NOT NULL
652 -- Name: messages_id_seq; Type: SEQUENCE; Schema: public; Owner: -
655 CREATE SEQUENCE messages_id_seq
664 -- Name: messages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
667 ALTER SEQUENCE messages_id_seq OWNED BY messages.id;
671 -- Name: node_tags; Type: TABLE; Schema: public; Owner: -; Tablespace:
674 CREATE TABLE node_tags (
675 node_id bigint NOT NULL,
676 version bigint NOT NULL,
677 k character varying(255) DEFAULT ''::character varying NOT NULL,
678 v character varying(255) DEFAULT ''::character varying NOT NULL
683 -- Name: nodes; Type: TABLE; Schema: public; Owner: -; Tablespace:
687 node_id bigint NOT NULL,
688 latitude integer NOT NULL,
689 longitude integer NOT NULL,
690 changeset_id bigint NOT NULL,
691 visible boolean NOT NULL,
692 "timestamp" timestamp without time zone NOT NULL,
693 tile bigint NOT NULL,
694 version bigint NOT NULL
699 -- Name: oauth_nonces; Type: TABLE; Schema: public; Owner: -; Tablespace:
702 CREATE TABLE oauth_nonces (
704 nonce character varying(255),
706 created_at timestamp without time zone,
707 updated_at timestamp without time zone
712 -- Name: oauth_nonces_id_seq; Type: SEQUENCE; Schema: public; Owner: -
715 CREATE SEQUENCE oauth_nonces_id_seq
724 -- Name: oauth_nonces_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
727 ALTER SEQUENCE oauth_nonces_id_seq OWNED BY oauth_nonces.id;
731 -- Name: oauth_tokens; Type: TABLE; Schema: public; Owner: -; Tablespace:
734 CREATE TABLE oauth_tokens (
737 type character varying(20),
738 client_application_id integer,
739 token character varying(50),
740 secret character varying(50),
741 authorized_at timestamp without time zone,
742 invalidated_at timestamp without time zone,
743 created_at timestamp without time zone,
744 updated_at timestamp without time zone,
745 allow_read_prefs boolean DEFAULT false NOT NULL,
746 allow_write_prefs boolean DEFAULT false NOT NULL,
747 allow_write_diary boolean DEFAULT false NOT NULL,
748 allow_write_api boolean DEFAULT false NOT NULL,
749 allow_read_gpx boolean DEFAULT false NOT NULL,
750 allow_write_gpx boolean DEFAULT false NOT NULL,
751 callback_url character varying(255),
752 verifier character varying(20),
753 scope character varying(255),
754 valid_to timestamp without time zone
759 -- Name: oauth_tokens_id_seq; Type: SEQUENCE; Schema: public; Owner: -
762 CREATE SEQUENCE oauth_tokens_id_seq
771 -- Name: oauth_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
774 ALTER SEQUENCE oauth_tokens_id_seq OWNED BY oauth_tokens.id;
778 -- Name: relation_members; Type: TABLE; Schema: public; Owner: -; Tablespace:
781 CREATE TABLE relation_members (
782 relation_id bigint DEFAULT 0 NOT NULL,
783 member_type nwr_enum NOT NULL,
784 member_id bigint NOT NULL,
785 member_role character varying(255) NOT NULL,
786 version bigint DEFAULT 0 NOT NULL,
787 sequence_id integer DEFAULT 0 NOT NULL
792 -- Name: relation_tags; Type: TABLE; Schema: public; Owner: -; Tablespace:
795 CREATE TABLE relation_tags (
796 relation_id bigint DEFAULT 0 NOT NULL,
797 k character varying(255) DEFAULT ''::character varying NOT NULL,
798 v character varying(255) DEFAULT ''::character varying NOT NULL,
799 version bigint NOT NULL
804 -- Name: relations; Type: TABLE; Schema: public; Owner: -; Tablespace:
807 CREATE TABLE relations (
808 relation_id bigint DEFAULT 0 NOT NULL,
809 changeset_id bigint NOT NULL,
810 "timestamp" timestamp without time zone NOT NULL,
811 version bigint NOT NULL,
812 visible boolean DEFAULT true NOT NULL
817 -- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -; Tablespace:
820 CREATE TABLE schema_migrations (
821 version character varying(255) NOT NULL
826 -- Name: sessions; Type: TABLE; Schema: public; Owner: -; Tablespace:
829 CREATE TABLE sessions (
831 session_id character varying(255),
833 created_at timestamp without time zone,
834 updated_at timestamp without time zone
839 -- Name: sessions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
842 CREATE SEQUENCE sessions_id_seq
851 -- Name: sessions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
854 ALTER SEQUENCE sessions_id_seq OWNED BY sessions.id;
858 -- Name: user_blocks; Type: TABLE; Schema: public; Owner: -; Tablespace:
861 CREATE TABLE user_blocks (
863 user_id bigint NOT NULL,
864 creator_id bigint NOT NULL,
865 reason text NOT NULL,
866 ends_at timestamp without time zone NOT NULL,
867 needs_view boolean DEFAULT false NOT NULL,
869 created_at timestamp without time zone,
870 updated_at timestamp without time zone
875 -- Name: user_blocks_id_seq; Type: SEQUENCE; Schema: public; Owner: -
878 CREATE SEQUENCE user_blocks_id_seq
887 -- Name: user_blocks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
890 ALTER SEQUENCE user_blocks_id_seq OWNED BY user_blocks.id;
894 -- Name: user_preferences; Type: TABLE; Schema: public; Owner: -; Tablespace:
897 CREATE TABLE user_preferences (
898 user_id bigint NOT NULL,
899 k character varying(255) NOT NULL,
900 v character varying(255) NOT NULL
905 -- Name: user_roles; Type: TABLE; Schema: public; Owner: -; Tablespace:
908 CREATE TABLE user_roles (
910 user_id bigint NOT NULL,
911 created_at timestamp without time zone,
912 updated_at timestamp without time zone,
913 role user_role_enum NOT NULL,
914 granter_id bigint NOT NULL
919 -- Name: user_roles_id_seq; Type: SEQUENCE; Schema: public; Owner: -
922 CREATE SEQUENCE user_roles_id_seq
931 -- Name: user_roles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
934 ALTER SEQUENCE user_roles_id_seq OWNED BY user_roles.id;
938 -- Name: user_tokens; Type: TABLE; Schema: public; Owner: -; Tablespace:
941 CREATE TABLE user_tokens (
943 user_id bigint NOT NULL,
944 token character varying(255) NOT NULL,
945 expiry timestamp without time zone NOT NULL,
951 -- Name: user_tokens_id_seq; Type: SEQUENCE; Schema: public; Owner: -
954 CREATE SEQUENCE user_tokens_id_seq
963 -- Name: user_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
966 ALTER SEQUENCE user_tokens_id_seq OWNED BY user_tokens.id;
970 -- Name: users; Type: TABLE; Schema: public; Owner: -; Tablespace:
974 email character varying(255) NOT NULL,
976 pass_crypt character varying(255) NOT NULL,
977 creation_time timestamp without time zone NOT NULL,
978 display_name character varying(255) DEFAULT ''::character varying NOT NULL,
979 data_public boolean DEFAULT false NOT NULL,
980 description text DEFAULT ''::text NOT NULL,
981 home_lat double precision,
982 home_lon double precision,
983 home_zoom smallint DEFAULT 3,
984 nearby integer DEFAULT 50,
985 pass_salt character varying(255),
986 image_file_name text,
987 email_valid boolean DEFAULT false NOT NULL,
988 new_email character varying(255),
989 creation_ip character varying(255),
990 languages character varying(255),
991 status user_status_enum DEFAULT 'pending'::user_status_enum NOT NULL,
992 terms_agreed timestamp without time zone,
993 consider_pd boolean DEFAULT false NOT NULL,
994 preferred_editor character varying(255),
995 terms_seen boolean DEFAULT false NOT NULL,
996 openid_url character varying(255),
997 image_fingerprint character varying(255)
1002 -- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1005 CREATE SEQUENCE users_id_seq
1014 -- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1017 ALTER SEQUENCE users_id_seq OWNED BY users.id;
1021 -- Name: way_nodes; Type: TABLE; Schema: public; Owner: -; Tablespace:
1024 CREATE TABLE way_nodes (
1025 way_id bigint NOT NULL,
1026 node_id bigint NOT NULL,
1027 version bigint NOT NULL,
1028 sequence_id bigint NOT NULL
1033 -- Name: way_tags; Type: TABLE; Schema: public; Owner: -; Tablespace:
1036 CREATE TABLE way_tags (
1037 way_id bigint DEFAULT 0 NOT NULL,
1038 k character varying(255) NOT NULL,
1039 v character varying(255) NOT NULL,
1040 version bigint NOT NULL
1045 -- Name: ways; Type: TABLE; Schema: public; Owner: -; Tablespace:
1049 way_id bigint DEFAULT 0 NOT NULL,
1050 changeset_id bigint NOT NULL,
1051 "timestamp" timestamp without time zone NOT NULL,
1052 version bigint NOT NULL,
1053 visible boolean DEFAULT true NOT NULL
1058 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1061 ALTER TABLE ONLY acls ALTER COLUMN id SET DEFAULT nextval('acls_id_seq'::regclass);
1065 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1068 ALTER TABLE ONLY changesets ALTER COLUMN id SET DEFAULT nextval('changesets_id_seq'::regclass);
1072 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1075 ALTER TABLE ONLY client_applications ALTER COLUMN id SET DEFAULT nextval('client_applications_id_seq'::regclass);
1079 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1082 ALTER TABLE ONLY countries ALTER COLUMN id SET DEFAULT nextval('countries_id_seq'::regclass);
1086 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1089 ALTER TABLE ONLY current_nodes ALTER COLUMN id SET DEFAULT nextval('current_nodes_id_seq'::regclass);
1093 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1096 ALTER TABLE ONLY current_relations ALTER COLUMN id SET DEFAULT nextval('current_relations_id_seq'::regclass);
1100 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1103 ALTER TABLE ONLY current_ways ALTER COLUMN id SET DEFAULT nextval('current_ways_id_seq'::regclass);
1107 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1110 ALTER TABLE ONLY diary_comments ALTER COLUMN id SET DEFAULT nextval('diary_comments_id_seq'::regclass);
1114 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1117 ALTER TABLE ONLY diary_entries ALTER COLUMN id SET DEFAULT nextval('diary_entries_id_seq'::regclass);
1121 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1124 ALTER TABLE ONLY friends ALTER COLUMN id SET DEFAULT nextval('friends_id_seq'::regclass);
1128 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1131 ALTER TABLE ONLY gpx_file_tags ALTER COLUMN id SET DEFAULT nextval('gpx_file_tags_id_seq'::regclass);
1135 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1138 ALTER TABLE ONLY gpx_files ALTER COLUMN id SET DEFAULT nextval('gpx_files_id_seq'::regclass);
1142 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1145 ALTER TABLE ONLY messages ALTER COLUMN id SET DEFAULT nextval('messages_id_seq'::regclass);
1149 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1152 ALTER TABLE ONLY oauth_nonces ALTER COLUMN id SET DEFAULT nextval('oauth_nonces_id_seq'::regclass);
1156 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1159 ALTER TABLE ONLY oauth_tokens ALTER COLUMN id SET DEFAULT nextval('oauth_tokens_id_seq'::regclass);
1163 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1166 ALTER TABLE ONLY sessions ALTER COLUMN id SET DEFAULT nextval('sessions_id_seq'::regclass);
1170 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1173 ALTER TABLE ONLY user_blocks ALTER COLUMN id SET DEFAULT nextval('user_blocks_id_seq'::regclass);
1177 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1180 ALTER TABLE ONLY user_roles ALTER COLUMN id SET DEFAULT nextval('user_roles_id_seq'::regclass);
1184 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1187 ALTER TABLE ONLY user_tokens ALTER COLUMN id SET DEFAULT nextval('user_tokens_id_seq'::regclass);
1191 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1194 ALTER TABLE ONLY users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass);
1198 -- Name: acls_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1201 ALTER TABLE ONLY acls
1202 ADD CONSTRAINT acls_pkey PRIMARY KEY (id);
1206 -- Name: changesets_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1209 ALTER TABLE ONLY changesets
1210 ADD CONSTRAINT changesets_pkey PRIMARY KEY (id);
1214 -- Name: client_applications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1217 ALTER TABLE ONLY client_applications
1218 ADD CONSTRAINT client_applications_pkey PRIMARY KEY (id);
1222 -- Name: countries_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1225 ALTER TABLE ONLY countries
1226 ADD CONSTRAINT countries_pkey PRIMARY KEY (id);
1230 -- Name: current_node_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1233 ALTER TABLE ONLY current_node_tags
1234 ADD CONSTRAINT current_node_tags_pkey PRIMARY KEY (node_id, k);
1238 -- Name: current_nodes_pkey1; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1241 ALTER TABLE ONLY current_nodes
1242 ADD CONSTRAINT current_nodes_pkey1 PRIMARY KEY (id);
1246 -- Name: current_relation_members_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1249 ALTER TABLE ONLY current_relation_members
1250 ADD CONSTRAINT current_relation_members_pkey PRIMARY KEY (relation_id, member_type, member_id, member_role, sequence_id);
1254 -- Name: current_relation_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1257 ALTER TABLE ONLY current_relation_tags
1258 ADD CONSTRAINT current_relation_tags_pkey PRIMARY KEY (relation_id, k);
1262 -- Name: current_relations_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1265 ALTER TABLE ONLY current_relations
1266 ADD CONSTRAINT current_relations_pkey PRIMARY KEY (id);
1270 -- Name: current_way_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1273 ALTER TABLE ONLY current_way_nodes
1274 ADD CONSTRAINT current_way_nodes_pkey PRIMARY KEY (way_id, sequence_id);
1278 -- Name: current_way_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1281 ALTER TABLE ONLY current_way_tags
1282 ADD CONSTRAINT current_way_tags_pkey PRIMARY KEY (way_id, k);
1286 -- Name: current_ways_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1289 ALTER TABLE ONLY current_ways
1290 ADD CONSTRAINT current_ways_pkey PRIMARY KEY (id);
1294 -- Name: diary_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1297 ALTER TABLE ONLY diary_comments
1298 ADD CONSTRAINT diary_comments_pkey PRIMARY KEY (id);
1302 -- Name: diary_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1305 ALTER TABLE ONLY diary_entries
1306 ADD CONSTRAINT diary_entries_pkey PRIMARY KEY (id);
1310 -- Name: friends_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1313 ALTER TABLE ONLY friends
1314 ADD CONSTRAINT friends_pkey PRIMARY KEY (id);
1318 -- Name: gpx_file_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1321 ALTER TABLE ONLY gpx_file_tags
1322 ADD CONSTRAINT gpx_file_tags_pkey PRIMARY KEY (id);
1326 -- Name: gpx_files_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1329 ALTER TABLE ONLY gpx_files
1330 ADD CONSTRAINT gpx_files_pkey PRIMARY KEY (id);
1334 -- Name: languages_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1337 ALTER TABLE ONLY languages
1338 ADD CONSTRAINT languages_pkey PRIMARY KEY (code);
1342 -- Name: messages_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1345 ALTER TABLE ONLY messages
1346 ADD CONSTRAINT messages_pkey PRIMARY KEY (id);
1350 -- Name: node_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1353 ALTER TABLE ONLY node_tags
1354 ADD CONSTRAINT node_tags_pkey PRIMARY KEY (node_id, version, k);
1358 -- Name: nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1361 ALTER TABLE ONLY nodes
1362 ADD CONSTRAINT nodes_pkey PRIMARY KEY (node_id, version);
1366 -- Name: oauth_nonces_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1369 ALTER TABLE ONLY oauth_nonces
1370 ADD CONSTRAINT oauth_nonces_pkey PRIMARY KEY (id);
1374 -- Name: oauth_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1377 ALTER TABLE ONLY oauth_tokens
1378 ADD CONSTRAINT oauth_tokens_pkey PRIMARY KEY (id);
1382 -- Name: relation_members_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1385 ALTER TABLE ONLY relation_members
1386 ADD CONSTRAINT relation_members_pkey PRIMARY KEY (relation_id, version, member_type, member_id, member_role, sequence_id);
1390 -- Name: relation_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1393 ALTER TABLE ONLY relation_tags
1394 ADD CONSTRAINT relation_tags_pkey PRIMARY KEY (relation_id, version, k);
1398 -- Name: relations_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1401 ALTER TABLE ONLY relations
1402 ADD CONSTRAINT relations_pkey PRIMARY KEY (relation_id, version);
1406 -- Name: sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1409 ALTER TABLE ONLY sessions
1410 ADD CONSTRAINT sessions_pkey PRIMARY KEY (id);
1414 -- Name: user_blocks_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1417 ALTER TABLE ONLY user_blocks
1418 ADD CONSTRAINT user_blocks_pkey PRIMARY KEY (id);
1422 -- Name: user_preferences_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1425 ALTER TABLE ONLY user_preferences
1426 ADD CONSTRAINT user_preferences_pkey PRIMARY KEY (user_id, k);
1430 -- Name: user_roles_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1433 ALTER TABLE ONLY user_roles
1434 ADD CONSTRAINT user_roles_pkey PRIMARY KEY (id);
1438 -- Name: user_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1441 ALTER TABLE ONLY user_tokens
1442 ADD CONSTRAINT user_tokens_pkey PRIMARY KEY (id);
1446 -- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1449 ALTER TABLE ONLY users
1450 ADD CONSTRAINT users_pkey PRIMARY KEY (id);
1454 -- Name: way_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1457 ALTER TABLE ONLY way_nodes
1458 ADD CONSTRAINT way_nodes_pkey PRIMARY KEY (way_id, version, sequence_id);
1462 -- Name: way_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1465 ALTER TABLE ONLY way_tags
1466 ADD CONSTRAINT way_tags_pkey PRIMARY KEY (way_id, version, k);
1470 -- Name: ways_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1473 ALTER TABLE ONLY ways
1474 ADD CONSTRAINT ways_pkey PRIMARY KEY (way_id, version);
1478 -- Name: acls_k_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1481 CREATE INDEX acls_k_idx ON acls USING btree (k);
1485 -- Name: changeset_tags_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1488 CREATE INDEX changeset_tags_id_idx ON changeset_tags USING btree (changeset_id);
1492 -- Name: changesets_bbox_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1495 CREATE INDEX changesets_bbox_idx ON changesets USING gist (min_lat, max_lat, min_lon, max_lon);
1499 -- Name: changesets_closed_at_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1502 CREATE INDEX changesets_closed_at_idx ON changesets USING btree (closed_at);
1506 -- Name: changesets_created_at_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1509 CREATE INDEX changesets_created_at_idx ON changesets USING btree (created_at);
1513 -- Name: changesets_user_id_created_at_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1516 CREATE INDEX changesets_user_id_created_at_idx ON changesets USING btree (user_id, created_at);
1520 -- Name: changesets_user_id_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1523 CREATE INDEX changesets_user_id_id_idx ON changesets USING btree (user_id, id);
1527 -- Name: countries_code_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1530 CREATE UNIQUE INDEX countries_code_idx ON countries USING btree (code);
1534 -- Name: current_nodes_tile_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1537 CREATE INDEX current_nodes_tile_idx ON current_nodes USING btree (tile);
1541 -- Name: current_nodes_timestamp_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1544 CREATE INDEX current_nodes_timestamp_idx ON current_nodes USING btree ("timestamp");
1548 -- Name: current_relation_members_member_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1551 CREATE INDEX current_relation_members_member_idx ON current_relation_members USING btree (member_type, member_id);
1555 -- Name: current_relations_timestamp_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1558 CREATE INDEX current_relations_timestamp_idx ON current_relations USING btree ("timestamp");
1562 -- Name: current_way_nodes_node_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1565 CREATE INDEX current_way_nodes_node_idx ON current_way_nodes USING btree (node_id);
1569 -- Name: current_ways_timestamp_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1572 CREATE INDEX current_ways_timestamp_idx ON current_ways USING btree ("timestamp");
1576 -- Name: diary_comment_user_id_created_at_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
1579 CREATE INDEX diary_comment_user_id_created_at_index ON diary_comments USING btree (user_id, created_at);
1583 -- Name: diary_comments_entry_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1586 CREATE UNIQUE INDEX diary_comments_entry_id_idx ON diary_comments USING btree (diary_entry_id, id);
1590 -- Name: diary_entry_created_at_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
1593 CREATE INDEX diary_entry_created_at_index ON diary_entries USING btree (created_at);
1597 -- Name: diary_entry_language_code_created_at_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
1600 CREATE INDEX diary_entry_language_code_created_at_index ON diary_entries USING btree (language_code, created_at);
1604 -- Name: diary_entry_user_id_created_at_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
1607 CREATE INDEX diary_entry_user_id_created_at_index ON diary_entries USING btree (user_id, created_at);
1611 -- Name: friends_user_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1614 CREATE INDEX friends_user_id_idx ON friends USING btree (user_id);
1618 -- Name: gpx_file_tags_gpxid_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1621 CREATE INDEX gpx_file_tags_gpxid_idx ON gpx_file_tags USING btree (gpx_id);
1625 -- Name: gpx_file_tags_tag_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1628 CREATE INDEX gpx_file_tags_tag_idx ON gpx_file_tags USING btree (tag);
1632 -- Name: gpx_files_timestamp_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1635 CREATE INDEX gpx_files_timestamp_idx ON gpx_files USING btree ("timestamp");
1639 -- Name: gpx_files_user_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1642 CREATE INDEX gpx_files_user_id_idx ON gpx_files USING btree (user_id);
1646 -- Name: gpx_files_visible_visibility_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1649 CREATE INDEX gpx_files_visible_visibility_idx ON gpx_files USING btree (visible, visibility);
1653 -- Name: index_client_applications_on_key; Type: INDEX; Schema: public; Owner: -; Tablespace:
1656 CREATE UNIQUE INDEX index_client_applications_on_key ON client_applications USING btree (key);
1660 -- Name: index_oauth_nonces_on_nonce_and_timestamp; Type: INDEX; Schema: public; Owner: -; Tablespace:
1663 CREATE UNIQUE INDEX index_oauth_nonces_on_nonce_and_timestamp ON oauth_nonces USING btree (nonce, "timestamp");
1667 -- Name: index_oauth_tokens_on_token; Type: INDEX; Schema: public; Owner: -; Tablespace:
1670 CREATE UNIQUE INDEX index_oauth_tokens_on_token ON oauth_tokens USING btree (token);
1674 -- Name: index_user_blocks_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
1677 CREATE INDEX index_user_blocks_on_user_id ON user_blocks USING btree (user_id);
1681 -- Name: messages_from_user_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1684 CREATE INDEX messages_from_user_id_idx ON messages USING btree (from_user_id);
1688 -- Name: messages_to_user_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1691 CREATE INDEX messages_to_user_id_idx ON messages USING btree (to_user_id);
1695 -- Name: nodes_changeset_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1698 CREATE INDEX nodes_changeset_id_idx ON nodes USING btree (changeset_id);
1702 -- Name: nodes_tile_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1705 CREATE INDEX nodes_tile_idx ON nodes USING btree (tile);
1709 -- Name: nodes_timestamp_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1712 CREATE INDEX nodes_timestamp_idx ON nodes USING btree ("timestamp");
1716 -- Name: points_gpxid_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1719 CREATE INDEX points_gpxid_idx ON gps_points USING btree (gpx_id);
1723 -- Name: points_tile_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1726 CREATE INDEX points_tile_idx ON gps_points USING btree (tile);
1730 -- Name: relation_members_member_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1733 CREATE INDEX relation_members_member_idx ON relation_members USING btree (member_type, member_id);
1737 -- Name: relations_changeset_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1740 CREATE INDEX relations_changeset_id_idx ON relations USING btree (changeset_id);
1744 -- Name: relations_timestamp_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1747 CREATE INDEX relations_timestamp_idx ON relations USING btree ("timestamp");
1751 -- Name: sessions_session_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1754 CREATE UNIQUE INDEX sessions_session_id_idx ON sessions USING btree (session_id);
1758 -- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -; Tablespace:
1761 CREATE UNIQUE INDEX unique_schema_migrations ON schema_migrations USING btree (version);
1765 -- Name: user_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1768 CREATE INDEX user_id_idx ON friends USING btree (friend_user_id);
1772 -- Name: user_openid_url_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1775 CREATE UNIQUE INDEX user_openid_url_idx ON users USING btree (openid_url);
1779 -- Name: user_roles_id_role_unique; Type: INDEX; Schema: public; Owner: -; Tablespace:
1782 CREATE UNIQUE INDEX user_roles_id_role_unique ON user_roles USING btree (user_id, role);
1786 -- Name: user_tokens_token_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1789 CREATE UNIQUE INDEX user_tokens_token_idx ON user_tokens USING btree (token);
1793 -- Name: user_tokens_user_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1796 CREATE INDEX user_tokens_user_id_idx ON user_tokens USING btree (user_id);
1800 -- Name: users_display_name_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1803 CREATE UNIQUE INDEX users_display_name_idx ON users USING btree (display_name);
1807 -- Name: users_display_name_lower_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1810 CREATE INDEX users_display_name_lower_idx ON users USING btree (lower((display_name)::text));
1814 -- Name: users_email_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1817 CREATE UNIQUE INDEX users_email_idx ON users USING btree (email);
1821 -- Name: users_email_lower_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1824 CREATE INDEX users_email_lower_idx ON users USING btree (lower((email)::text));
1828 -- Name: way_nodes_node_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1831 CREATE INDEX way_nodes_node_idx ON way_nodes USING btree (node_id);
1835 -- Name: ways_changeset_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1838 CREATE INDEX ways_changeset_id_idx ON ways USING btree (changeset_id);
1842 -- Name: ways_timestamp_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1845 CREATE INDEX ways_timestamp_idx ON ways USING btree ("timestamp");
1849 -- Name: changeset_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1852 ALTER TABLE ONLY changeset_tags
1853 ADD CONSTRAINT changeset_tags_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
1857 -- Name: changesets_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1860 ALTER TABLE ONLY changesets
1861 ADD CONSTRAINT changesets_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
1865 -- Name: client_applications_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1868 ALTER TABLE ONLY client_applications
1869 ADD CONSTRAINT client_applications_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
1873 -- Name: current_node_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1876 ALTER TABLE ONLY current_node_tags
1877 ADD CONSTRAINT current_node_tags_id_fkey FOREIGN KEY (node_id) REFERENCES current_nodes(id);
1881 -- Name: current_nodes_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1884 ALTER TABLE ONLY current_nodes
1885 ADD CONSTRAINT current_nodes_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
1889 -- Name: current_relation_members_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1892 ALTER TABLE ONLY current_relation_members
1893 ADD CONSTRAINT current_relation_members_id_fkey FOREIGN KEY (relation_id) REFERENCES current_relations(id);
1897 -- Name: current_relation_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1900 ALTER TABLE ONLY current_relation_tags
1901 ADD CONSTRAINT current_relation_tags_id_fkey FOREIGN KEY (relation_id) REFERENCES current_relations(id);
1905 -- Name: current_relations_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1908 ALTER TABLE ONLY current_relations
1909 ADD CONSTRAINT current_relations_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
1913 -- Name: current_way_nodes_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1916 ALTER TABLE ONLY current_way_nodes
1917 ADD CONSTRAINT current_way_nodes_id_fkey FOREIGN KEY (way_id) REFERENCES current_ways(id);
1921 -- Name: current_way_nodes_node_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1924 ALTER TABLE ONLY current_way_nodes
1925 ADD CONSTRAINT current_way_nodes_node_id_fkey FOREIGN KEY (node_id) REFERENCES current_nodes(id);
1929 -- Name: current_way_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1932 ALTER TABLE ONLY current_way_tags
1933 ADD CONSTRAINT current_way_tags_id_fkey FOREIGN KEY (way_id) REFERENCES current_ways(id);
1937 -- Name: current_ways_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1940 ALTER TABLE ONLY current_ways
1941 ADD CONSTRAINT current_ways_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
1945 -- Name: diary_comments_diary_entry_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1948 ALTER TABLE ONLY diary_comments
1949 ADD CONSTRAINT diary_comments_diary_entry_id_fkey FOREIGN KEY (diary_entry_id) REFERENCES diary_entries(id);
1953 -- Name: diary_comments_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1956 ALTER TABLE ONLY diary_comments
1957 ADD CONSTRAINT diary_comments_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
1961 -- Name: diary_entries_language_code_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1964 ALTER TABLE ONLY diary_entries
1965 ADD CONSTRAINT diary_entries_language_code_fkey FOREIGN KEY (language_code) REFERENCES languages(code);
1969 -- Name: diary_entries_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1972 ALTER TABLE ONLY diary_entries
1973 ADD CONSTRAINT diary_entries_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
1977 -- Name: friends_friend_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1980 ALTER TABLE ONLY friends
1981 ADD CONSTRAINT friends_friend_user_id_fkey FOREIGN KEY (friend_user_id) REFERENCES users(id);
1985 -- Name: friends_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1988 ALTER TABLE ONLY friends
1989 ADD CONSTRAINT friends_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
1993 -- Name: gps_points_gpx_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1996 ALTER TABLE ONLY gps_points
1997 ADD CONSTRAINT gps_points_gpx_id_fkey FOREIGN KEY (gpx_id) REFERENCES gpx_files(id);
2001 -- Name: gpx_file_tags_gpx_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2004 ALTER TABLE ONLY gpx_file_tags
2005 ADD CONSTRAINT gpx_file_tags_gpx_id_fkey FOREIGN KEY (gpx_id) REFERENCES gpx_files(id);
2009 -- Name: gpx_files_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2012 ALTER TABLE ONLY gpx_files
2013 ADD CONSTRAINT gpx_files_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2017 -- Name: messages_from_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2020 ALTER TABLE ONLY messages
2021 ADD CONSTRAINT messages_from_user_id_fkey FOREIGN KEY (from_user_id) REFERENCES users(id);
2025 -- Name: messages_to_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2028 ALTER TABLE ONLY messages
2029 ADD CONSTRAINT messages_to_user_id_fkey FOREIGN KEY (to_user_id) REFERENCES users(id);
2033 -- Name: node_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2036 ALTER TABLE ONLY node_tags
2037 ADD CONSTRAINT node_tags_id_fkey FOREIGN KEY (node_id, version) REFERENCES nodes(node_id, version);
2041 -- Name: nodes_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2044 ALTER TABLE ONLY nodes
2045 ADD CONSTRAINT nodes_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2049 -- Name: oauth_tokens_client_application_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2052 ALTER TABLE ONLY oauth_tokens
2053 ADD CONSTRAINT oauth_tokens_client_application_id_fkey FOREIGN KEY (client_application_id) REFERENCES client_applications(id);
2057 -- Name: oauth_tokens_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2060 ALTER TABLE ONLY oauth_tokens
2061 ADD CONSTRAINT oauth_tokens_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2065 -- Name: relation_members_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2068 ALTER TABLE ONLY relation_members
2069 ADD CONSTRAINT relation_members_id_fkey FOREIGN KEY (relation_id, version) REFERENCES relations(relation_id, version);
2073 -- Name: relation_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2076 ALTER TABLE ONLY relation_tags
2077 ADD CONSTRAINT relation_tags_id_fkey FOREIGN KEY (relation_id, version) REFERENCES relations(relation_id, version);
2081 -- Name: relations_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2084 ALTER TABLE ONLY relations
2085 ADD CONSTRAINT relations_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2089 -- Name: user_blocks_moderator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2092 ALTER TABLE ONLY user_blocks
2093 ADD CONSTRAINT user_blocks_moderator_id_fkey FOREIGN KEY (creator_id) REFERENCES users(id);
2097 -- Name: user_blocks_revoker_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2100 ALTER TABLE ONLY user_blocks
2101 ADD CONSTRAINT user_blocks_revoker_id_fkey FOREIGN KEY (revoker_id) REFERENCES users(id);
2105 -- Name: user_blocks_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2108 ALTER TABLE ONLY user_blocks
2109 ADD CONSTRAINT user_blocks_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2113 -- Name: user_preferences_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2116 ALTER TABLE ONLY user_preferences
2117 ADD CONSTRAINT user_preferences_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2121 -- Name: user_roles_granter_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2124 ALTER TABLE ONLY user_roles
2125 ADD CONSTRAINT user_roles_granter_id_fkey FOREIGN KEY (granter_id) REFERENCES users(id);
2129 -- Name: user_roles_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2132 ALTER TABLE ONLY user_roles
2133 ADD CONSTRAINT user_roles_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2137 -- Name: user_tokens_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2140 ALTER TABLE ONLY user_tokens
2141 ADD CONSTRAINT user_tokens_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2145 -- Name: way_nodes_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2148 ALTER TABLE ONLY way_nodes
2149 ADD CONSTRAINT way_nodes_id_fkey FOREIGN KEY (way_id, version) REFERENCES ways(way_id, version);
2153 -- Name: way_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2156 ALTER TABLE ONLY way_tags
2157 ADD CONSTRAINT way_tags_id_fkey FOREIGN KEY (way_id, version) REFERENCES ways(way_id, version);
2161 -- Name: ways_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2164 ALTER TABLE ONLY ways
2165 ADD CONSTRAINT ways_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2169 -- PostgreSQL database dump complete
2172 INSERT INTO schema_migrations (version) VALUES ('1');
2174 INSERT INTO schema_migrations (version) VALUES ('10');
2176 INSERT INTO schema_migrations (version) VALUES ('11');
2178 INSERT INTO schema_migrations (version) VALUES ('12');
2180 INSERT INTO schema_migrations (version) VALUES ('13');
2182 INSERT INTO schema_migrations (version) VALUES ('14');
2184 INSERT INTO schema_migrations (version) VALUES ('15');
2186 INSERT INTO schema_migrations (version) VALUES ('16');
2188 INSERT INTO schema_migrations (version) VALUES ('17');
2190 INSERT INTO schema_migrations (version) VALUES ('18');
2192 INSERT INTO schema_migrations (version) VALUES ('19');
2194 INSERT INTO schema_migrations (version) VALUES ('2');
2196 INSERT INTO schema_migrations (version) VALUES ('20');
2198 INSERT INTO schema_migrations (version) VALUES ('20100513171259');
2200 INSERT INTO schema_migrations (version) VALUES ('20100516124737');
2202 INSERT INTO schema_migrations (version) VALUES ('20100910084426');
2204 INSERT INTO schema_migrations (version) VALUES ('20101114011429');
2206 INSERT INTO schema_migrations (version) VALUES ('20110322001319');
2208 INSERT INTO schema_migrations (version) VALUES ('20110925112722');
2210 INSERT INTO schema_migrations (version) VALUES ('20111116184519');
2212 INSERT INTO schema_migrations (version) VALUES ('20111212183945');
2214 INSERT INTO schema_migrations (version) VALUES ('20120123184321');
2216 INSERT INTO schema_migrations (version) VALUES ('20120208122334');
2218 INSERT INTO schema_migrations (version) VALUES ('20120208194454');
2220 INSERT INTO schema_migrations (version) VALUES ('20120219161649');
2222 INSERT INTO schema_migrations (version) VALUES ('21');
2224 INSERT INTO schema_migrations (version) VALUES ('22');
2226 INSERT INTO schema_migrations (version) VALUES ('23');
2228 INSERT INTO schema_migrations (version) VALUES ('24');
2230 INSERT INTO schema_migrations (version) VALUES ('25');
2232 INSERT INTO schema_migrations (version) VALUES ('26');
2234 INSERT INTO schema_migrations (version) VALUES ('27');
2236 INSERT INTO schema_migrations (version) VALUES ('28');
2238 INSERT INTO schema_migrations (version) VALUES ('29');
2240 INSERT INTO schema_migrations (version) VALUES ('3');
2242 INSERT INTO schema_migrations (version) VALUES ('30');
2244 INSERT INTO schema_migrations (version) VALUES ('31');
2246 INSERT INTO schema_migrations (version) VALUES ('32');
2248 INSERT INTO schema_migrations (version) VALUES ('33');
2250 INSERT INTO schema_migrations (version) VALUES ('34');
2252 INSERT INTO schema_migrations (version) VALUES ('35');
2254 INSERT INTO schema_migrations (version) VALUES ('36');
2256 INSERT INTO schema_migrations (version) VALUES ('37');
2258 INSERT INTO schema_migrations (version) VALUES ('38');
2260 INSERT INTO schema_migrations (version) VALUES ('39');
2262 INSERT INTO schema_migrations (version) VALUES ('4');
2264 INSERT INTO schema_migrations (version) VALUES ('40');
2266 INSERT INTO schema_migrations (version) VALUES ('41');
2268 INSERT INTO schema_migrations (version) VALUES ('42');
2270 INSERT INTO schema_migrations (version) VALUES ('43');
2272 INSERT INTO schema_migrations (version) VALUES ('44');
2274 INSERT INTO schema_migrations (version) VALUES ('45');
2276 INSERT INTO schema_migrations (version) VALUES ('46');
2278 INSERT INTO schema_migrations (version) VALUES ('47');
2280 INSERT INTO schema_migrations (version) VALUES ('48');
2282 INSERT INTO schema_migrations (version) VALUES ('49');
2284 INSERT INTO schema_migrations (version) VALUES ('5');
2286 INSERT INTO schema_migrations (version) VALUES ('50');
2288 INSERT INTO schema_migrations (version) VALUES ('51');
2290 INSERT INTO schema_migrations (version) VALUES ('52');
2292 INSERT INTO schema_migrations (version) VALUES ('6');
2294 INSERT INTO schema_migrations (version) VALUES ('7');
2296 INSERT INTO schema_migrations (version) VALUES ('8');
2298 INSERT INTO schema_migrations (version) VALUES ('9');