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,
451 body_format format_enum DEFAULT 'html'::format_enum NOT NULL
456 -- Name: diary_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
459 CREATE SEQUENCE diary_comments_id_seq
468 -- Name: diary_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
471 ALTER SEQUENCE diary_comments_id_seq OWNED BY diary_comments.id;
475 -- Name: diary_entries; Type: TABLE; Schema: public; Owner: -; Tablespace:
478 CREATE TABLE diary_entries (
480 user_id bigint NOT NULL,
481 title character varying(255) NOT NULL,
483 created_at timestamp without time zone NOT NULL,
484 updated_at timestamp without time zone NOT NULL,
485 latitude double precision,
486 longitude double precision,
487 language_code character varying(255) DEFAULT 'en'::character varying NOT NULL,
488 visible boolean DEFAULT true NOT NULL,
489 body_format format_enum DEFAULT 'html'::format_enum NOT NULL
494 -- Name: diary_entries_id_seq; Type: SEQUENCE; Schema: public; Owner: -
497 CREATE SEQUENCE diary_entries_id_seq
506 -- Name: diary_entries_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
509 ALTER SEQUENCE diary_entries_id_seq OWNED BY diary_entries.id;
513 -- Name: friends; Type: TABLE; Schema: public; Owner: -; Tablespace:
516 CREATE TABLE friends (
518 user_id bigint NOT NULL,
519 friend_user_id bigint NOT NULL
524 -- Name: friends_id_seq; Type: SEQUENCE; Schema: public; Owner: -
527 CREATE SEQUENCE friends_id_seq
536 -- Name: friends_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
539 ALTER SEQUENCE friends_id_seq OWNED BY friends.id;
543 -- Name: gps_points; Type: TABLE; Schema: public; Owner: -; Tablespace:
546 CREATE TABLE gps_points (
547 altitude double precision,
548 trackid integer NOT NULL,
549 latitude integer NOT NULL,
550 longitude integer NOT NULL,
551 gpx_id bigint NOT NULL,
552 "timestamp" timestamp without time zone,
558 -- Name: gpx_file_tags; Type: TABLE; Schema: public; Owner: -; Tablespace:
561 CREATE TABLE gpx_file_tags (
562 gpx_id bigint DEFAULT 0 NOT NULL,
563 tag character varying(255) NOT NULL,
569 -- Name: gpx_file_tags_id_seq; Type: SEQUENCE; Schema: public; Owner: -
572 CREATE SEQUENCE gpx_file_tags_id_seq
581 -- Name: gpx_file_tags_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
584 ALTER SEQUENCE gpx_file_tags_id_seq OWNED BY gpx_file_tags.id;
588 -- Name: gpx_files; Type: TABLE; Schema: public; Owner: -; Tablespace:
591 CREATE TABLE gpx_files (
593 user_id bigint NOT NULL,
594 visible boolean DEFAULT true NOT NULL,
595 name character varying(255) DEFAULT ''::character varying NOT NULL,
597 latitude double precision,
598 longitude double precision,
599 "timestamp" timestamp without time zone NOT NULL,
600 description character varying(255) DEFAULT ''::character varying NOT NULL,
601 inserted boolean NOT NULL,
602 visibility gpx_visibility_enum DEFAULT 'public'::gpx_visibility_enum NOT NULL
607 -- Name: gpx_files_id_seq; Type: SEQUENCE; Schema: public; Owner: -
610 CREATE SEQUENCE gpx_files_id_seq
619 -- Name: gpx_files_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
622 ALTER SEQUENCE gpx_files_id_seq OWNED BY gpx_files.id;
626 -- Name: languages; Type: TABLE; Schema: public; Owner: -; Tablespace:
629 CREATE TABLE languages (
630 code character varying(255) NOT NULL,
631 english_name character varying(255) NOT NULL,
632 native_name character varying(255)
637 -- Name: messages; Type: TABLE; Schema: public; Owner: -; Tablespace:
640 CREATE TABLE messages (
642 from_user_id bigint NOT NULL,
643 title character varying(255) NOT NULL,
645 sent_on timestamp without time zone NOT NULL,
646 message_read boolean DEFAULT false NOT NULL,
647 to_user_id bigint NOT NULL,
648 to_user_visible boolean DEFAULT true NOT NULL,
649 from_user_visible boolean DEFAULT true NOT NULL,
650 body_format format_enum DEFAULT 'html'::format_enum NOT NULL
655 -- Name: messages_id_seq; Type: SEQUENCE; Schema: public; Owner: -
658 CREATE SEQUENCE messages_id_seq
667 -- Name: messages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
670 ALTER SEQUENCE messages_id_seq OWNED BY messages.id;
674 -- Name: node_tags; Type: TABLE; Schema: public; Owner: -; Tablespace:
677 CREATE TABLE node_tags (
678 node_id bigint NOT NULL,
679 version bigint NOT NULL,
680 k character varying(255) DEFAULT ''::character varying NOT NULL,
681 v character varying(255) DEFAULT ''::character varying NOT NULL
686 -- Name: nodes; Type: TABLE; Schema: public; Owner: -; Tablespace:
690 node_id bigint NOT NULL,
691 latitude integer NOT NULL,
692 longitude integer NOT NULL,
693 changeset_id bigint NOT NULL,
694 visible boolean NOT NULL,
695 "timestamp" timestamp without time zone NOT NULL,
696 tile bigint NOT NULL,
697 version bigint NOT NULL
702 -- Name: oauth_nonces; Type: TABLE; Schema: public; Owner: -; Tablespace:
705 CREATE TABLE oauth_nonces (
707 nonce character varying(255),
709 created_at timestamp without time zone,
710 updated_at timestamp without time zone
715 -- Name: oauth_nonces_id_seq; Type: SEQUENCE; Schema: public; Owner: -
718 CREATE SEQUENCE oauth_nonces_id_seq
727 -- Name: oauth_nonces_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
730 ALTER SEQUENCE oauth_nonces_id_seq OWNED BY oauth_nonces.id;
734 -- Name: oauth_tokens; Type: TABLE; Schema: public; Owner: -; Tablespace:
737 CREATE TABLE oauth_tokens (
740 type character varying(20),
741 client_application_id integer,
742 token character varying(50),
743 secret character varying(50),
744 authorized_at timestamp without time zone,
745 invalidated_at timestamp without time zone,
746 created_at timestamp without time zone,
747 updated_at timestamp without time zone,
748 allow_read_prefs boolean DEFAULT false NOT NULL,
749 allow_write_prefs boolean DEFAULT false NOT NULL,
750 allow_write_diary boolean DEFAULT false NOT NULL,
751 allow_write_api boolean DEFAULT false NOT NULL,
752 allow_read_gpx boolean DEFAULT false NOT NULL,
753 allow_write_gpx boolean DEFAULT false NOT NULL,
754 callback_url character varying(255),
755 verifier character varying(20),
756 scope character varying(255),
757 valid_to timestamp without time zone
762 -- Name: oauth_tokens_id_seq; Type: SEQUENCE; Schema: public; Owner: -
765 CREATE SEQUENCE oauth_tokens_id_seq
774 -- Name: oauth_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
777 ALTER SEQUENCE oauth_tokens_id_seq OWNED BY oauth_tokens.id;
781 -- Name: relation_members; Type: TABLE; Schema: public; Owner: -; Tablespace:
784 CREATE TABLE relation_members (
785 relation_id bigint DEFAULT 0 NOT NULL,
786 member_type nwr_enum NOT NULL,
787 member_id bigint NOT NULL,
788 member_role character varying(255) NOT NULL,
789 version bigint DEFAULT 0 NOT NULL,
790 sequence_id integer DEFAULT 0 NOT NULL
795 -- Name: relation_tags; Type: TABLE; Schema: public; Owner: -; Tablespace:
798 CREATE TABLE relation_tags (
799 relation_id bigint DEFAULT 0 NOT NULL,
800 k character varying(255) DEFAULT ''::character varying NOT NULL,
801 v character varying(255) DEFAULT ''::character varying NOT NULL,
802 version bigint NOT NULL
807 -- Name: relations; Type: TABLE; Schema: public; Owner: -; Tablespace:
810 CREATE TABLE relations (
811 relation_id bigint DEFAULT 0 NOT NULL,
812 changeset_id bigint NOT NULL,
813 "timestamp" timestamp without time zone NOT NULL,
814 version bigint NOT NULL,
815 visible boolean DEFAULT true NOT NULL
820 -- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -; Tablespace:
823 CREATE TABLE schema_migrations (
824 version character varying(255) NOT NULL
829 -- Name: sessions; Type: TABLE; Schema: public; Owner: -; Tablespace:
832 CREATE TABLE sessions (
834 session_id character varying(255),
836 created_at timestamp without time zone,
837 updated_at timestamp without time zone
842 -- Name: sessions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
845 CREATE SEQUENCE sessions_id_seq
854 -- Name: sessions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
857 ALTER SEQUENCE sessions_id_seq OWNED BY sessions.id;
861 -- Name: user_blocks; Type: TABLE; Schema: public; Owner: -; Tablespace:
864 CREATE TABLE user_blocks (
866 user_id bigint NOT NULL,
867 creator_id bigint NOT NULL,
868 reason text NOT NULL,
869 ends_at timestamp without time zone NOT NULL,
870 needs_view boolean DEFAULT false NOT NULL,
872 created_at timestamp without time zone,
873 updated_at timestamp without time zone,
874 reason_format format_enum DEFAULT 'html'::format_enum NOT NULL
879 -- Name: user_blocks_id_seq; Type: SEQUENCE; Schema: public; Owner: -
882 CREATE SEQUENCE user_blocks_id_seq
891 -- Name: user_blocks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
894 ALTER SEQUENCE user_blocks_id_seq OWNED BY user_blocks.id;
898 -- Name: user_preferences; Type: TABLE; Schema: public; Owner: -; Tablespace:
901 CREATE TABLE user_preferences (
902 user_id bigint NOT NULL,
903 k character varying(255) NOT NULL,
904 v character varying(255) NOT NULL
909 -- Name: user_roles; Type: TABLE; Schema: public; Owner: -; Tablespace:
912 CREATE TABLE user_roles (
914 user_id bigint NOT NULL,
915 created_at timestamp without time zone,
916 updated_at timestamp without time zone,
917 role user_role_enum NOT NULL,
918 granter_id bigint NOT NULL
923 -- Name: user_roles_id_seq; Type: SEQUENCE; Schema: public; Owner: -
926 CREATE SEQUENCE user_roles_id_seq
935 -- Name: user_roles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
938 ALTER SEQUENCE user_roles_id_seq OWNED BY user_roles.id;
942 -- Name: user_tokens; Type: TABLE; Schema: public; Owner: -; Tablespace:
945 CREATE TABLE user_tokens (
947 user_id bigint NOT NULL,
948 token character varying(255) NOT NULL,
949 expiry timestamp without time zone NOT NULL,
955 -- Name: user_tokens_id_seq; Type: SEQUENCE; Schema: public; Owner: -
958 CREATE SEQUENCE user_tokens_id_seq
967 -- Name: user_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
970 ALTER SEQUENCE user_tokens_id_seq OWNED BY user_tokens.id;
974 -- Name: users; Type: TABLE; Schema: public; Owner: -; Tablespace:
978 email character varying(255) NOT NULL,
980 pass_crypt character varying(255) NOT NULL,
981 creation_time timestamp without time zone NOT NULL,
982 display_name character varying(255) DEFAULT ''::character varying NOT NULL,
983 data_public boolean DEFAULT false NOT NULL,
984 description text DEFAULT ''::text NOT NULL,
985 home_lat double precision,
986 home_lon double precision,
987 home_zoom smallint DEFAULT 3,
988 nearby integer DEFAULT 50,
989 pass_salt character varying(255),
990 image_file_name text,
991 email_valid boolean DEFAULT false NOT NULL,
992 new_email character varying(255),
993 creation_ip character varying(255),
994 languages character varying(255),
995 status user_status_enum DEFAULT 'pending'::user_status_enum NOT NULL,
996 terms_agreed timestamp without time zone,
997 consider_pd boolean DEFAULT false NOT NULL,
998 preferred_editor character varying(255),
999 terms_seen boolean DEFAULT false NOT NULL,
1000 openid_url character varying(255),
1001 image_fingerprint character varying(255),
1002 description_format format_enum DEFAULT 'html'::format_enum NOT NULL
1007 -- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1010 CREATE SEQUENCE users_id_seq
1019 -- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1022 ALTER SEQUENCE users_id_seq OWNED BY users.id;
1026 -- Name: way_nodes; Type: TABLE; Schema: public; Owner: -; Tablespace:
1029 CREATE TABLE way_nodes (
1030 way_id bigint NOT NULL,
1031 node_id bigint NOT NULL,
1032 version bigint NOT NULL,
1033 sequence_id bigint NOT NULL
1038 -- Name: way_tags; Type: TABLE; Schema: public; Owner: -; Tablespace:
1041 CREATE TABLE way_tags (
1042 way_id bigint DEFAULT 0 NOT NULL,
1043 k character varying(255) NOT NULL,
1044 v character varying(255) NOT NULL,
1045 version bigint NOT NULL
1050 -- Name: ways; Type: TABLE; Schema: public; Owner: -; Tablespace:
1054 way_id bigint DEFAULT 0 NOT NULL,
1055 changeset_id bigint NOT NULL,
1056 "timestamp" timestamp without time zone NOT NULL,
1057 version bigint NOT NULL,
1058 visible boolean DEFAULT true NOT NULL
1063 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1066 ALTER TABLE ONLY acls ALTER COLUMN id SET DEFAULT nextval('acls_id_seq'::regclass);
1070 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1073 ALTER TABLE ONLY changesets ALTER COLUMN id SET DEFAULT nextval('changesets_id_seq'::regclass);
1077 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1080 ALTER TABLE ONLY client_applications ALTER COLUMN id SET DEFAULT nextval('client_applications_id_seq'::regclass);
1084 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1087 ALTER TABLE ONLY countries ALTER COLUMN id SET DEFAULT nextval('countries_id_seq'::regclass);
1091 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1094 ALTER TABLE ONLY current_nodes ALTER COLUMN id SET DEFAULT nextval('current_nodes_id_seq'::regclass);
1098 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1101 ALTER TABLE ONLY current_relations ALTER COLUMN id SET DEFAULT nextval('current_relations_id_seq'::regclass);
1105 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1108 ALTER TABLE ONLY current_ways ALTER COLUMN id SET DEFAULT nextval('current_ways_id_seq'::regclass);
1112 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1115 ALTER TABLE ONLY diary_comments ALTER COLUMN id SET DEFAULT nextval('diary_comments_id_seq'::regclass);
1119 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1122 ALTER TABLE ONLY diary_entries ALTER COLUMN id SET DEFAULT nextval('diary_entries_id_seq'::regclass);
1126 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1129 ALTER TABLE ONLY friends ALTER COLUMN id SET DEFAULT nextval('friends_id_seq'::regclass);
1133 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1136 ALTER TABLE ONLY gpx_file_tags ALTER COLUMN id SET DEFAULT nextval('gpx_file_tags_id_seq'::regclass);
1140 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1143 ALTER TABLE ONLY gpx_files ALTER COLUMN id SET DEFAULT nextval('gpx_files_id_seq'::regclass);
1147 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1150 ALTER TABLE ONLY messages ALTER COLUMN id SET DEFAULT nextval('messages_id_seq'::regclass);
1154 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1157 ALTER TABLE ONLY oauth_nonces ALTER COLUMN id SET DEFAULT nextval('oauth_nonces_id_seq'::regclass);
1161 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1164 ALTER TABLE ONLY oauth_tokens ALTER COLUMN id SET DEFAULT nextval('oauth_tokens_id_seq'::regclass);
1168 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1171 ALTER TABLE ONLY sessions ALTER COLUMN id SET DEFAULT nextval('sessions_id_seq'::regclass);
1175 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1178 ALTER TABLE ONLY user_blocks ALTER COLUMN id SET DEFAULT nextval('user_blocks_id_seq'::regclass);
1182 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1185 ALTER TABLE ONLY user_roles ALTER COLUMN id SET DEFAULT nextval('user_roles_id_seq'::regclass);
1189 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1192 ALTER TABLE ONLY user_tokens ALTER COLUMN id SET DEFAULT nextval('user_tokens_id_seq'::regclass);
1196 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1199 ALTER TABLE ONLY users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass);
1203 -- Name: acls_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1206 ALTER TABLE ONLY acls
1207 ADD CONSTRAINT acls_pkey PRIMARY KEY (id);
1211 -- Name: changesets_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1214 ALTER TABLE ONLY changesets
1215 ADD CONSTRAINT changesets_pkey PRIMARY KEY (id);
1219 -- Name: client_applications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1222 ALTER TABLE ONLY client_applications
1223 ADD CONSTRAINT client_applications_pkey PRIMARY KEY (id);
1227 -- Name: countries_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1230 ALTER TABLE ONLY countries
1231 ADD CONSTRAINT countries_pkey PRIMARY KEY (id);
1235 -- Name: current_node_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1238 ALTER TABLE ONLY current_node_tags
1239 ADD CONSTRAINT current_node_tags_pkey PRIMARY KEY (node_id, k);
1243 -- Name: current_nodes_pkey1; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1246 ALTER TABLE ONLY current_nodes
1247 ADD CONSTRAINT current_nodes_pkey1 PRIMARY KEY (id);
1251 -- Name: current_relation_members_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1254 ALTER TABLE ONLY current_relation_members
1255 ADD CONSTRAINT current_relation_members_pkey PRIMARY KEY (relation_id, member_type, member_id, member_role, sequence_id);
1259 -- Name: current_relation_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1262 ALTER TABLE ONLY current_relation_tags
1263 ADD CONSTRAINT current_relation_tags_pkey PRIMARY KEY (relation_id, k);
1267 -- Name: current_relations_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1270 ALTER TABLE ONLY current_relations
1271 ADD CONSTRAINT current_relations_pkey PRIMARY KEY (id);
1275 -- Name: current_way_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1278 ALTER TABLE ONLY current_way_nodes
1279 ADD CONSTRAINT current_way_nodes_pkey PRIMARY KEY (way_id, sequence_id);
1283 -- Name: current_way_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1286 ALTER TABLE ONLY current_way_tags
1287 ADD CONSTRAINT current_way_tags_pkey PRIMARY KEY (way_id, k);
1291 -- Name: current_ways_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1294 ALTER TABLE ONLY current_ways
1295 ADD CONSTRAINT current_ways_pkey PRIMARY KEY (id);
1299 -- Name: diary_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1302 ALTER TABLE ONLY diary_comments
1303 ADD CONSTRAINT diary_comments_pkey PRIMARY KEY (id);
1307 -- Name: diary_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1310 ALTER TABLE ONLY diary_entries
1311 ADD CONSTRAINT diary_entries_pkey PRIMARY KEY (id);
1315 -- Name: friends_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1318 ALTER TABLE ONLY friends
1319 ADD CONSTRAINT friends_pkey PRIMARY KEY (id);
1323 -- Name: gpx_file_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1326 ALTER TABLE ONLY gpx_file_tags
1327 ADD CONSTRAINT gpx_file_tags_pkey PRIMARY KEY (id);
1331 -- Name: gpx_files_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1334 ALTER TABLE ONLY gpx_files
1335 ADD CONSTRAINT gpx_files_pkey PRIMARY KEY (id);
1339 -- Name: languages_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1342 ALTER TABLE ONLY languages
1343 ADD CONSTRAINT languages_pkey PRIMARY KEY (code);
1347 -- Name: messages_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1350 ALTER TABLE ONLY messages
1351 ADD CONSTRAINT messages_pkey PRIMARY KEY (id);
1355 -- Name: node_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1358 ALTER TABLE ONLY node_tags
1359 ADD CONSTRAINT node_tags_pkey PRIMARY KEY (node_id, version, k);
1363 -- Name: nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1366 ALTER TABLE ONLY nodes
1367 ADD CONSTRAINT nodes_pkey PRIMARY KEY (node_id, version);
1371 -- Name: oauth_nonces_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1374 ALTER TABLE ONLY oauth_nonces
1375 ADD CONSTRAINT oauth_nonces_pkey PRIMARY KEY (id);
1379 -- Name: oauth_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1382 ALTER TABLE ONLY oauth_tokens
1383 ADD CONSTRAINT oauth_tokens_pkey PRIMARY KEY (id);
1387 -- Name: relation_members_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1390 ALTER TABLE ONLY relation_members
1391 ADD CONSTRAINT relation_members_pkey PRIMARY KEY (relation_id, version, member_type, member_id, member_role, sequence_id);
1395 -- Name: relation_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1398 ALTER TABLE ONLY relation_tags
1399 ADD CONSTRAINT relation_tags_pkey PRIMARY KEY (relation_id, version, k);
1403 -- Name: relations_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1406 ALTER TABLE ONLY relations
1407 ADD CONSTRAINT relations_pkey PRIMARY KEY (relation_id, version);
1411 -- Name: sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1414 ALTER TABLE ONLY sessions
1415 ADD CONSTRAINT sessions_pkey PRIMARY KEY (id);
1419 -- Name: user_blocks_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1422 ALTER TABLE ONLY user_blocks
1423 ADD CONSTRAINT user_blocks_pkey PRIMARY KEY (id);
1427 -- Name: user_preferences_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1430 ALTER TABLE ONLY user_preferences
1431 ADD CONSTRAINT user_preferences_pkey PRIMARY KEY (user_id, k);
1435 -- Name: user_roles_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1438 ALTER TABLE ONLY user_roles
1439 ADD CONSTRAINT user_roles_pkey PRIMARY KEY (id);
1443 -- Name: user_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1446 ALTER TABLE ONLY user_tokens
1447 ADD CONSTRAINT user_tokens_pkey PRIMARY KEY (id);
1451 -- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1454 ALTER TABLE ONLY users
1455 ADD CONSTRAINT users_pkey PRIMARY KEY (id);
1459 -- Name: way_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1462 ALTER TABLE ONLY way_nodes
1463 ADD CONSTRAINT way_nodes_pkey PRIMARY KEY (way_id, version, sequence_id);
1467 -- Name: way_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1470 ALTER TABLE ONLY way_tags
1471 ADD CONSTRAINT way_tags_pkey PRIMARY KEY (way_id, version, k);
1475 -- Name: ways_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1478 ALTER TABLE ONLY ways
1479 ADD CONSTRAINT ways_pkey PRIMARY KEY (way_id, version);
1483 -- Name: acls_k_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1486 CREATE INDEX acls_k_idx ON acls USING btree (k);
1490 -- Name: changeset_tags_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1493 CREATE INDEX changeset_tags_id_idx ON changeset_tags USING btree (changeset_id);
1497 -- Name: changesets_bbox_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1500 CREATE INDEX changesets_bbox_idx ON changesets USING gist (min_lat, max_lat, min_lon, max_lon);
1504 -- Name: changesets_closed_at_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1507 CREATE INDEX changesets_closed_at_idx ON changesets USING btree (closed_at);
1511 -- Name: changesets_created_at_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1514 CREATE INDEX changesets_created_at_idx ON changesets USING btree (created_at);
1518 -- Name: changesets_user_id_created_at_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1521 CREATE INDEX changesets_user_id_created_at_idx ON changesets USING btree (user_id, created_at);
1525 -- Name: changesets_user_id_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1528 CREATE INDEX changesets_user_id_id_idx ON changesets USING btree (user_id, id);
1532 -- Name: countries_code_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1535 CREATE UNIQUE INDEX countries_code_idx ON countries USING btree (code);
1539 -- Name: current_nodes_tile_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1542 CREATE INDEX current_nodes_tile_idx ON current_nodes USING btree (tile);
1546 -- Name: current_nodes_timestamp_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1549 CREATE INDEX current_nodes_timestamp_idx ON current_nodes USING btree ("timestamp");
1553 -- Name: current_relation_members_member_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1556 CREATE INDEX current_relation_members_member_idx ON current_relation_members USING btree (member_type, member_id);
1560 -- Name: current_relations_timestamp_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1563 CREATE INDEX current_relations_timestamp_idx ON current_relations USING btree ("timestamp");
1567 -- Name: current_way_nodes_node_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1570 CREATE INDEX current_way_nodes_node_idx ON current_way_nodes USING btree (node_id);
1574 -- Name: current_ways_timestamp_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1577 CREATE INDEX current_ways_timestamp_idx ON current_ways USING btree ("timestamp");
1581 -- Name: diary_comment_user_id_created_at_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
1584 CREATE INDEX diary_comment_user_id_created_at_index ON diary_comments USING btree (user_id, created_at);
1588 -- Name: diary_comments_entry_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1591 CREATE UNIQUE INDEX diary_comments_entry_id_idx ON diary_comments USING btree (diary_entry_id, id);
1595 -- Name: diary_entry_created_at_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
1598 CREATE INDEX diary_entry_created_at_index ON diary_entries USING btree (created_at);
1602 -- Name: diary_entry_language_code_created_at_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
1605 CREATE INDEX diary_entry_language_code_created_at_index ON diary_entries USING btree (language_code, created_at);
1609 -- Name: diary_entry_user_id_created_at_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
1612 CREATE INDEX diary_entry_user_id_created_at_index ON diary_entries USING btree (user_id, created_at);
1616 -- Name: friends_user_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1619 CREATE INDEX friends_user_id_idx ON friends USING btree (user_id);
1623 -- Name: gpx_file_tags_gpxid_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1626 CREATE INDEX gpx_file_tags_gpxid_idx ON gpx_file_tags USING btree (gpx_id);
1630 -- Name: gpx_file_tags_tag_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1633 CREATE INDEX gpx_file_tags_tag_idx ON gpx_file_tags USING btree (tag);
1637 -- Name: gpx_files_timestamp_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1640 CREATE INDEX gpx_files_timestamp_idx ON gpx_files USING btree ("timestamp");
1644 -- Name: gpx_files_user_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1647 CREATE INDEX gpx_files_user_id_idx ON gpx_files USING btree (user_id);
1651 -- Name: gpx_files_visible_visibility_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1654 CREATE INDEX gpx_files_visible_visibility_idx ON gpx_files USING btree (visible, visibility);
1658 -- Name: index_client_applications_on_key; Type: INDEX; Schema: public; Owner: -; Tablespace:
1661 CREATE UNIQUE INDEX index_client_applications_on_key ON client_applications USING btree (key);
1665 -- Name: index_oauth_nonces_on_nonce_and_timestamp; Type: INDEX; Schema: public; Owner: -; Tablespace:
1668 CREATE UNIQUE INDEX index_oauth_nonces_on_nonce_and_timestamp ON oauth_nonces USING btree (nonce, "timestamp");
1672 -- Name: index_oauth_tokens_on_token; Type: INDEX; Schema: public; Owner: -; Tablespace:
1675 CREATE UNIQUE INDEX index_oauth_tokens_on_token ON oauth_tokens USING btree (token);
1679 -- Name: index_user_blocks_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
1682 CREATE INDEX index_user_blocks_on_user_id ON user_blocks USING btree (user_id);
1686 -- Name: messages_from_user_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1689 CREATE INDEX messages_from_user_id_idx ON messages USING btree (from_user_id);
1693 -- Name: messages_to_user_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1696 CREATE INDEX messages_to_user_id_idx ON messages USING btree (to_user_id);
1700 -- Name: nodes_changeset_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1703 CREATE INDEX nodes_changeset_id_idx ON nodes USING btree (changeset_id);
1707 -- Name: nodes_tile_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1710 CREATE INDEX nodes_tile_idx ON nodes USING btree (tile);
1714 -- Name: nodes_timestamp_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1717 CREATE INDEX nodes_timestamp_idx ON nodes USING btree ("timestamp");
1721 -- Name: points_gpxid_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1724 CREATE INDEX points_gpxid_idx ON gps_points USING btree (gpx_id);
1728 -- Name: points_tile_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1731 CREATE INDEX points_tile_idx ON gps_points USING btree (tile);
1735 -- Name: relation_members_member_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1738 CREATE INDEX relation_members_member_idx ON relation_members USING btree (member_type, member_id);
1742 -- Name: relations_changeset_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1745 CREATE INDEX relations_changeset_id_idx ON relations USING btree (changeset_id);
1749 -- Name: relations_timestamp_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1752 CREATE INDEX relations_timestamp_idx ON relations USING btree ("timestamp");
1756 -- Name: sessions_session_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1759 CREATE UNIQUE INDEX sessions_session_id_idx ON sessions USING btree (session_id);
1763 -- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -; Tablespace:
1766 CREATE UNIQUE INDEX unique_schema_migrations ON schema_migrations USING btree (version);
1770 -- Name: user_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1773 CREATE INDEX user_id_idx ON friends USING btree (friend_user_id);
1777 -- Name: user_openid_url_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1780 CREATE UNIQUE INDEX user_openid_url_idx ON users USING btree (openid_url);
1784 -- Name: user_roles_id_role_unique; Type: INDEX; Schema: public; Owner: -; Tablespace:
1787 CREATE UNIQUE INDEX user_roles_id_role_unique ON user_roles USING btree (user_id, role);
1791 -- Name: user_tokens_token_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1794 CREATE UNIQUE INDEX user_tokens_token_idx ON user_tokens USING btree (token);
1798 -- Name: user_tokens_user_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1801 CREATE INDEX user_tokens_user_id_idx ON user_tokens USING btree (user_id);
1805 -- Name: users_display_name_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1808 CREATE UNIQUE INDEX users_display_name_idx ON users USING btree (display_name);
1812 -- Name: users_display_name_lower_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1815 CREATE INDEX users_display_name_lower_idx ON users USING btree (lower((display_name)::text));
1819 -- Name: users_email_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1822 CREATE UNIQUE INDEX users_email_idx ON users USING btree (email);
1826 -- Name: users_email_lower_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1829 CREATE INDEX users_email_lower_idx ON users USING btree (lower((email)::text));
1833 -- Name: way_nodes_node_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1836 CREATE INDEX way_nodes_node_idx ON way_nodes USING btree (node_id);
1840 -- Name: ways_changeset_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1843 CREATE INDEX ways_changeset_id_idx ON ways USING btree (changeset_id);
1847 -- Name: ways_timestamp_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1850 CREATE INDEX ways_timestamp_idx ON ways USING btree ("timestamp");
1854 -- Name: changeset_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1857 ALTER TABLE ONLY changeset_tags
1858 ADD CONSTRAINT changeset_tags_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
1862 -- Name: changesets_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1865 ALTER TABLE ONLY changesets
1866 ADD CONSTRAINT changesets_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
1870 -- Name: client_applications_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1873 ALTER TABLE ONLY client_applications
1874 ADD CONSTRAINT client_applications_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
1878 -- Name: current_node_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1881 ALTER TABLE ONLY current_node_tags
1882 ADD CONSTRAINT current_node_tags_id_fkey FOREIGN KEY (node_id) REFERENCES current_nodes(id);
1886 -- Name: current_nodes_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1889 ALTER TABLE ONLY current_nodes
1890 ADD CONSTRAINT current_nodes_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
1894 -- Name: current_relation_members_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1897 ALTER TABLE ONLY current_relation_members
1898 ADD CONSTRAINT current_relation_members_id_fkey FOREIGN KEY (relation_id) REFERENCES current_relations(id);
1902 -- Name: current_relation_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1905 ALTER TABLE ONLY current_relation_tags
1906 ADD CONSTRAINT current_relation_tags_id_fkey FOREIGN KEY (relation_id) REFERENCES current_relations(id);
1910 -- Name: current_relations_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1913 ALTER TABLE ONLY current_relations
1914 ADD CONSTRAINT current_relations_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
1918 -- Name: current_way_nodes_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1921 ALTER TABLE ONLY current_way_nodes
1922 ADD CONSTRAINT current_way_nodes_id_fkey FOREIGN KEY (way_id) REFERENCES current_ways(id);
1926 -- Name: current_way_nodes_node_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1929 ALTER TABLE ONLY current_way_nodes
1930 ADD CONSTRAINT current_way_nodes_node_id_fkey FOREIGN KEY (node_id) REFERENCES current_nodes(id);
1934 -- Name: current_way_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1937 ALTER TABLE ONLY current_way_tags
1938 ADD CONSTRAINT current_way_tags_id_fkey FOREIGN KEY (way_id) REFERENCES current_ways(id);
1942 -- Name: current_ways_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1945 ALTER TABLE ONLY current_ways
1946 ADD CONSTRAINT current_ways_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
1950 -- Name: diary_comments_diary_entry_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1953 ALTER TABLE ONLY diary_comments
1954 ADD CONSTRAINT diary_comments_diary_entry_id_fkey FOREIGN KEY (diary_entry_id) REFERENCES diary_entries(id);
1958 -- Name: diary_comments_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1961 ALTER TABLE ONLY diary_comments
1962 ADD CONSTRAINT diary_comments_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
1966 -- Name: diary_entries_language_code_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1969 ALTER TABLE ONLY diary_entries
1970 ADD CONSTRAINT diary_entries_language_code_fkey FOREIGN KEY (language_code) REFERENCES languages(code);
1974 -- Name: diary_entries_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1977 ALTER TABLE ONLY diary_entries
1978 ADD CONSTRAINT diary_entries_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
1982 -- Name: friends_friend_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1985 ALTER TABLE ONLY friends
1986 ADD CONSTRAINT friends_friend_user_id_fkey FOREIGN KEY (friend_user_id) REFERENCES users(id);
1990 -- Name: friends_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
1993 ALTER TABLE ONLY friends
1994 ADD CONSTRAINT friends_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
1998 -- Name: gps_points_gpx_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2001 ALTER TABLE ONLY gps_points
2002 ADD CONSTRAINT gps_points_gpx_id_fkey FOREIGN KEY (gpx_id) REFERENCES gpx_files(id);
2006 -- Name: gpx_file_tags_gpx_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2009 ALTER TABLE ONLY gpx_file_tags
2010 ADD CONSTRAINT gpx_file_tags_gpx_id_fkey FOREIGN KEY (gpx_id) REFERENCES gpx_files(id);
2014 -- Name: gpx_files_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2017 ALTER TABLE ONLY gpx_files
2018 ADD CONSTRAINT gpx_files_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2022 -- Name: messages_from_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2025 ALTER TABLE ONLY messages
2026 ADD CONSTRAINT messages_from_user_id_fkey FOREIGN KEY (from_user_id) REFERENCES users(id);
2030 -- Name: messages_to_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2033 ALTER TABLE ONLY messages
2034 ADD CONSTRAINT messages_to_user_id_fkey FOREIGN KEY (to_user_id) REFERENCES users(id);
2038 -- Name: node_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2041 ALTER TABLE ONLY node_tags
2042 ADD CONSTRAINT node_tags_id_fkey FOREIGN KEY (node_id, version) REFERENCES nodes(node_id, version);
2046 -- Name: nodes_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2049 ALTER TABLE ONLY nodes
2050 ADD CONSTRAINT nodes_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2054 -- Name: oauth_tokens_client_application_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2057 ALTER TABLE ONLY oauth_tokens
2058 ADD CONSTRAINT oauth_tokens_client_application_id_fkey FOREIGN KEY (client_application_id) REFERENCES client_applications(id);
2062 -- Name: oauth_tokens_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2065 ALTER TABLE ONLY oauth_tokens
2066 ADD CONSTRAINT oauth_tokens_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2070 -- Name: relation_members_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2073 ALTER TABLE ONLY relation_members
2074 ADD CONSTRAINT relation_members_id_fkey FOREIGN KEY (relation_id, version) REFERENCES relations(relation_id, version);
2078 -- Name: relation_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2081 ALTER TABLE ONLY relation_tags
2082 ADD CONSTRAINT relation_tags_id_fkey FOREIGN KEY (relation_id, version) REFERENCES relations(relation_id, version);
2086 -- Name: relations_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2089 ALTER TABLE ONLY relations
2090 ADD CONSTRAINT relations_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2094 -- Name: user_blocks_moderator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2097 ALTER TABLE ONLY user_blocks
2098 ADD CONSTRAINT user_blocks_moderator_id_fkey FOREIGN KEY (creator_id) REFERENCES users(id);
2102 -- Name: user_blocks_revoker_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2105 ALTER TABLE ONLY user_blocks
2106 ADD CONSTRAINT user_blocks_revoker_id_fkey FOREIGN KEY (revoker_id) REFERENCES users(id);
2110 -- Name: user_blocks_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2113 ALTER TABLE ONLY user_blocks
2114 ADD CONSTRAINT user_blocks_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2118 -- Name: user_preferences_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2121 ALTER TABLE ONLY user_preferences
2122 ADD CONSTRAINT user_preferences_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2126 -- Name: user_roles_granter_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2129 ALTER TABLE ONLY user_roles
2130 ADD CONSTRAINT user_roles_granter_id_fkey FOREIGN KEY (granter_id) REFERENCES users(id);
2134 -- Name: user_roles_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2137 ALTER TABLE ONLY user_roles
2138 ADD CONSTRAINT user_roles_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2142 -- Name: user_tokens_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2145 ALTER TABLE ONLY user_tokens
2146 ADD CONSTRAINT user_tokens_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2150 -- Name: way_nodes_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2153 ALTER TABLE ONLY way_nodes
2154 ADD CONSTRAINT way_nodes_id_fkey FOREIGN KEY (way_id, version) REFERENCES ways(way_id, version);
2158 -- Name: way_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2161 ALTER TABLE ONLY way_tags
2162 ADD CONSTRAINT way_tags_id_fkey FOREIGN KEY (way_id, version) REFERENCES ways(way_id, version);
2166 -- Name: ways_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2169 ALTER TABLE ONLY ways
2170 ADD CONSTRAINT ways_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2174 -- PostgreSQL database dump complete
2177 INSERT INTO schema_migrations (version) VALUES ('1');
2179 INSERT INTO schema_migrations (version) VALUES ('10');
2181 INSERT INTO schema_migrations (version) VALUES ('11');
2183 INSERT INTO schema_migrations (version) VALUES ('12');
2185 INSERT INTO schema_migrations (version) VALUES ('13');
2187 INSERT INTO schema_migrations (version) VALUES ('14');
2189 INSERT INTO schema_migrations (version) VALUES ('15');
2191 INSERT INTO schema_migrations (version) VALUES ('16');
2193 INSERT INTO schema_migrations (version) VALUES ('17');
2195 INSERT INTO schema_migrations (version) VALUES ('18');
2197 INSERT INTO schema_migrations (version) VALUES ('19');
2199 INSERT INTO schema_migrations (version) VALUES ('2');
2201 INSERT INTO schema_migrations (version) VALUES ('20');
2203 INSERT INTO schema_migrations (version) VALUES ('20100513171259');
2205 INSERT INTO schema_migrations (version) VALUES ('20100516124737');
2207 INSERT INTO schema_migrations (version) VALUES ('20100910084426');
2209 INSERT INTO schema_migrations (version) VALUES ('20101114011429');
2211 INSERT INTO schema_migrations (version) VALUES ('20110322001319');
2213 INSERT INTO schema_migrations (version) VALUES ('20110925112722');
2215 INSERT INTO schema_migrations (version) VALUES ('20111116184519');
2217 INSERT INTO schema_migrations (version) VALUES ('20111212183945');
2219 INSERT INTO schema_migrations (version) VALUES ('20120123184321');
2221 INSERT INTO schema_migrations (version) VALUES ('20120208122334');
2223 INSERT INTO schema_migrations (version) VALUES ('20120208194454');
2225 INSERT INTO schema_migrations (version) VALUES ('20120214210114');
2227 INSERT INTO schema_migrations (version) VALUES ('20120219161649');
2229 INSERT INTO schema_migrations (version) VALUES ('21');
2231 INSERT INTO schema_migrations (version) VALUES ('22');
2233 INSERT INTO schema_migrations (version) VALUES ('23');
2235 INSERT INTO schema_migrations (version) VALUES ('24');
2237 INSERT INTO schema_migrations (version) VALUES ('25');
2239 INSERT INTO schema_migrations (version) VALUES ('26');
2241 INSERT INTO schema_migrations (version) VALUES ('27');
2243 INSERT INTO schema_migrations (version) VALUES ('28');
2245 INSERT INTO schema_migrations (version) VALUES ('29');
2247 INSERT INTO schema_migrations (version) VALUES ('3');
2249 INSERT INTO schema_migrations (version) VALUES ('30');
2251 INSERT INTO schema_migrations (version) VALUES ('31');
2253 INSERT INTO schema_migrations (version) VALUES ('32');
2255 INSERT INTO schema_migrations (version) VALUES ('33');
2257 INSERT INTO schema_migrations (version) VALUES ('34');
2259 INSERT INTO schema_migrations (version) VALUES ('35');
2261 INSERT INTO schema_migrations (version) VALUES ('36');
2263 INSERT INTO schema_migrations (version) VALUES ('37');
2265 INSERT INTO schema_migrations (version) VALUES ('38');
2267 INSERT INTO schema_migrations (version) VALUES ('39');
2269 INSERT INTO schema_migrations (version) VALUES ('4');
2271 INSERT INTO schema_migrations (version) VALUES ('40');
2273 INSERT INTO schema_migrations (version) VALUES ('41');
2275 INSERT INTO schema_migrations (version) VALUES ('42');
2277 INSERT INTO schema_migrations (version) VALUES ('43');
2279 INSERT INTO schema_migrations (version) VALUES ('44');
2281 INSERT INTO schema_migrations (version) VALUES ('45');
2283 INSERT INTO schema_migrations (version) VALUES ('46');
2285 INSERT INTO schema_migrations (version) VALUES ('47');
2287 INSERT INTO schema_migrations (version) VALUES ('48');
2289 INSERT INTO schema_migrations (version) VALUES ('49');
2291 INSERT INTO schema_migrations (version) VALUES ('5');
2293 INSERT INTO schema_migrations (version) VALUES ('50');
2295 INSERT INTO schema_migrations (version) VALUES ('51');
2297 INSERT INTO schema_migrations (version) VALUES ('52');
2299 INSERT INTO schema_migrations (version) VALUES ('6');
2301 INSERT INTO schema_migrations (version) VALUES ('7');
2303 INSERT INTO schema_migrations (version) VALUES ('8');
2305 INSERT INTO schema_migrations (version) VALUES ('9');