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/next.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/next.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/next.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,
703 -- Name: oauth_nonces; Type: TABLE; Schema: public; Owner: -; Tablespace:
706 CREATE TABLE oauth_nonces (
708 nonce character varying(255),
710 created_at timestamp without time zone,
711 updated_at timestamp without time zone
716 -- Name: oauth_nonces_id_seq; Type: SEQUENCE; Schema: public; Owner: -
719 CREATE SEQUENCE oauth_nonces_id_seq
728 -- Name: oauth_nonces_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
731 ALTER SEQUENCE oauth_nonces_id_seq OWNED BY oauth_nonces.id;
735 -- Name: oauth_tokens; Type: TABLE; Schema: public; Owner: -; Tablespace:
738 CREATE TABLE oauth_tokens (
741 type character varying(20),
742 client_application_id integer,
743 token character varying(50),
744 secret character varying(50),
745 authorized_at timestamp without time zone,
746 invalidated_at timestamp without time zone,
747 created_at timestamp without time zone,
748 updated_at timestamp without time zone,
749 allow_read_prefs boolean DEFAULT false NOT NULL,
750 allow_write_prefs boolean DEFAULT false NOT NULL,
751 allow_write_diary boolean DEFAULT false NOT NULL,
752 allow_write_api boolean DEFAULT false NOT NULL,
753 allow_read_gpx boolean DEFAULT false NOT NULL,
754 allow_write_gpx boolean DEFAULT false NOT NULL,
755 callback_url character varying(255),
756 verifier character varying(20),
757 scope character varying(255),
758 valid_to timestamp without time zone
763 -- Name: oauth_tokens_id_seq; Type: SEQUENCE; Schema: public; Owner: -
766 CREATE SEQUENCE oauth_tokens_id_seq
775 -- Name: oauth_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
778 ALTER SEQUENCE oauth_tokens_id_seq OWNED BY oauth_tokens.id;
782 -- Name: redactions; Type: TABLE; Schema: public; Owner: -; Tablespace:
785 CREATE TABLE redactions (
787 title character varying(255),
789 created_at timestamp without time zone NOT NULL,
790 updated_at timestamp without time zone NOT NULL,
791 user_id bigint NOT NULL,
792 description_format format_enum DEFAULT 'markdown'::format_enum NOT NULL
797 -- Name: redactions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
800 CREATE SEQUENCE redactions_id_seq
809 -- Name: redactions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
812 ALTER SEQUENCE redactions_id_seq OWNED BY redactions.id;
816 -- Name: relation_members; Type: TABLE; Schema: public; Owner: -; Tablespace:
819 CREATE TABLE relation_members (
820 relation_id bigint DEFAULT 0 NOT NULL,
821 member_type nwr_enum NOT NULL,
822 member_id bigint NOT NULL,
823 member_role character varying(255) NOT NULL,
824 version bigint DEFAULT 0 NOT NULL,
825 sequence_id integer DEFAULT 0 NOT NULL
830 -- Name: relation_tags; Type: TABLE; Schema: public; Owner: -; Tablespace:
833 CREATE TABLE relation_tags (
834 relation_id bigint DEFAULT 0 NOT NULL,
835 k character varying(255) DEFAULT ''::character varying NOT NULL,
836 v character varying(255) DEFAULT ''::character varying NOT NULL,
837 version bigint NOT NULL
842 -- Name: relations; Type: TABLE; Schema: public; Owner: -; Tablespace:
845 CREATE TABLE relations (
846 relation_id bigint DEFAULT 0 NOT NULL,
847 changeset_id bigint NOT NULL,
848 "timestamp" timestamp without time zone NOT NULL,
849 version bigint NOT NULL,
850 visible boolean DEFAULT true NOT NULL,
856 -- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -; Tablespace:
859 CREATE TABLE schema_migrations (
860 version character varying(255) NOT NULL
865 -- Name: user_blocks; Type: TABLE; Schema: public; Owner: -; Tablespace:
868 CREATE TABLE user_blocks (
870 user_id bigint NOT NULL,
871 creator_id bigint NOT NULL,
872 reason text NOT NULL,
873 ends_at timestamp without time zone NOT NULL,
874 needs_view boolean DEFAULT false NOT NULL,
876 created_at timestamp without time zone,
877 updated_at timestamp without time zone,
878 reason_format format_enum DEFAULT 'html'::format_enum NOT NULL
883 -- Name: user_blocks_id_seq; Type: SEQUENCE; Schema: public; Owner: -
886 CREATE SEQUENCE user_blocks_id_seq
895 -- Name: user_blocks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
898 ALTER SEQUENCE user_blocks_id_seq OWNED BY user_blocks.id;
902 -- Name: user_preferences; Type: TABLE; Schema: public; Owner: -; Tablespace:
905 CREATE TABLE user_preferences (
906 user_id bigint NOT NULL,
907 k character varying(255) NOT NULL,
908 v character varying(255) NOT NULL
913 -- Name: user_roles; Type: TABLE; Schema: public; Owner: -; Tablespace:
916 CREATE TABLE user_roles (
918 user_id bigint NOT NULL,
919 created_at timestamp without time zone,
920 updated_at timestamp without time zone,
921 role user_role_enum NOT NULL,
922 granter_id bigint NOT NULL
927 -- Name: user_roles_id_seq; Type: SEQUENCE; Schema: public; Owner: -
930 CREATE SEQUENCE user_roles_id_seq
939 -- Name: user_roles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
942 ALTER SEQUENCE user_roles_id_seq OWNED BY user_roles.id;
946 -- Name: user_tokens; Type: TABLE; Schema: public; Owner: -; Tablespace:
949 CREATE TABLE user_tokens (
951 user_id bigint NOT NULL,
952 token character varying(255) NOT NULL,
953 expiry timestamp without time zone NOT NULL,
959 -- Name: user_tokens_id_seq; Type: SEQUENCE; Schema: public; Owner: -
962 CREATE SEQUENCE user_tokens_id_seq
971 -- Name: user_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
974 ALTER SEQUENCE user_tokens_id_seq OWNED BY user_tokens.id;
978 -- Name: users; Type: TABLE; Schema: public; Owner: -; Tablespace:
982 email character varying(255) NOT NULL,
984 pass_crypt character varying(255) NOT NULL,
985 creation_time timestamp without time zone NOT NULL,
986 display_name character varying(255) DEFAULT ''::character varying NOT NULL,
987 data_public boolean DEFAULT false NOT NULL,
988 description text DEFAULT ''::text NOT NULL,
989 home_lat double precision,
990 home_lon double precision,
991 home_zoom smallint DEFAULT 3,
992 nearby integer DEFAULT 50,
993 pass_salt character varying(255),
994 image_file_name text,
995 email_valid boolean DEFAULT false NOT NULL,
996 new_email character varying(255),
997 creation_ip character varying(255),
998 languages character varying(255),
999 status user_status_enum DEFAULT 'pending'::user_status_enum NOT NULL,
1000 terms_agreed timestamp without time zone,
1001 consider_pd boolean DEFAULT false NOT NULL,
1002 openid_url character varying(255),
1003 preferred_editor character varying(255),
1004 terms_seen boolean DEFAULT false NOT NULL,
1005 image_fingerprint character varying(255),
1006 description_format format_enum DEFAULT 'html'::format_enum NOT NULL,
1007 changesets_count integer DEFAULT 0 NOT NULL,
1008 traces_count integer DEFAULT 0 NOT NULL
1013 -- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1016 CREATE SEQUENCE users_id_seq
1025 -- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1028 ALTER SEQUENCE users_id_seq OWNED BY users.id;
1032 -- Name: way_nodes; Type: TABLE; Schema: public; Owner: -; Tablespace:
1035 CREATE TABLE way_nodes (
1036 way_id bigint NOT NULL,
1037 node_id bigint NOT NULL,
1038 version bigint NOT NULL,
1039 sequence_id bigint NOT NULL
1044 -- Name: way_tags; Type: TABLE; Schema: public; Owner: -; Tablespace:
1047 CREATE TABLE way_tags (
1048 way_id bigint DEFAULT 0 NOT NULL,
1049 k character varying(255) NOT NULL,
1050 v character varying(255) NOT NULL,
1051 version bigint NOT NULL
1056 -- Name: ways; Type: TABLE; Schema: public; Owner: -; Tablespace:
1060 way_id bigint DEFAULT 0 NOT NULL,
1061 changeset_id bigint NOT NULL,
1062 "timestamp" timestamp without time zone NOT NULL,
1063 version bigint NOT NULL,
1064 visible boolean DEFAULT true NOT NULL,
1065 redaction_id integer
1070 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1073 ALTER TABLE ONLY acls ALTER COLUMN id SET DEFAULT nextval('acls_id_seq'::regclass);
1077 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1080 ALTER TABLE ONLY changesets ALTER COLUMN id SET DEFAULT nextval('changesets_id_seq'::regclass);
1084 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1087 ALTER TABLE ONLY client_applications ALTER COLUMN id SET DEFAULT nextval('client_applications_id_seq'::regclass);
1091 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1094 ALTER TABLE ONLY countries ALTER COLUMN id SET DEFAULT nextval('countries_id_seq'::regclass);
1098 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1101 ALTER TABLE ONLY current_nodes ALTER COLUMN id SET DEFAULT nextval('current_nodes_id_seq'::regclass);
1105 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1108 ALTER TABLE ONLY current_relations ALTER COLUMN id SET DEFAULT nextval('current_relations_id_seq'::regclass);
1112 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1115 ALTER TABLE ONLY current_ways ALTER COLUMN id SET DEFAULT nextval('current_ways_id_seq'::regclass);
1119 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1122 ALTER TABLE ONLY diary_comments ALTER COLUMN id SET DEFAULT nextval('diary_comments_id_seq'::regclass);
1126 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1129 ALTER TABLE ONLY diary_entries ALTER COLUMN id SET DEFAULT nextval('diary_entries_id_seq'::regclass);
1133 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1136 ALTER TABLE ONLY friends ALTER COLUMN id SET DEFAULT nextval('friends_id_seq'::regclass);
1140 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1143 ALTER TABLE ONLY gpx_file_tags ALTER COLUMN id SET DEFAULT nextval('gpx_file_tags_id_seq'::regclass);
1147 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1150 ALTER TABLE ONLY gpx_files ALTER COLUMN id SET DEFAULT nextval('gpx_files_id_seq'::regclass);
1154 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1157 ALTER TABLE ONLY messages ALTER COLUMN id SET DEFAULT nextval('messages_id_seq'::regclass);
1161 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1164 ALTER TABLE ONLY oauth_nonces ALTER COLUMN id SET DEFAULT nextval('oauth_nonces_id_seq'::regclass);
1168 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1171 ALTER TABLE ONLY oauth_tokens ALTER COLUMN id SET DEFAULT nextval('oauth_tokens_id_seq'::regclass);
1175 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1178 ALTER TABLE ONLY redactions ALTER COLUMN id SET DEFAULT nextval('redactions_id_seq'::regclass);
1182 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1185 ALTER TABLE ONLY user_blocks ALTER COLUMN id SET DEFAULT nextval('user_blocks_id_seq'::regclass);
1189 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1192 ALTER TABLE ONLY user_roles ALTER COLUMN id SET DEFAULT nextval('user_roles_id_seq'::regclass);
1196 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1199 ALTER TABLE ONLY user_tokens ALTER COLUMN id SET DEFAULT nextval('user_tokens_id_seq'::regclass);
1203 -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1206 ALTER TABLE ONLY users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass);
1210 -- Name: acls_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1213 ALTER TABLE ONLY acls
1214 ADD CONSTRAINT acls_pkey PRIMARY KEY (id);
1218 -- Name: changesets_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1221 ALTER TABLE ONLY changesets
1222 ADD CONSTRAINT changesets_pkey PRIMARY KEY (id);
1226 -- Name: client_applications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1229 ALTER TABLE ONLY client_applications
1230 ADD CONSTRAINT client_applications_pkey PRIMARY KEY (id);
1234 -- Name: countries_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1237 ALTER TABLE ONLY countries
1238 ADD CONSTRAINT countries_pkey PRIMARY KEY (id);
1242 -- Name: current_node_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1245 ALTER TABLE ONLY current_node_tags
1246 ADD CONSTRAINT current_node_tags_pkey PRIMARY KEY (node_id, k);
1250 -- Name: current_nodes_pkey1; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1253 ALTER TABLE ONLY current_nodes
1254 ADD CONSTRAINT current_nodes_pkey1 PRIMARY KEY (id);
1258 -- Name: current_relation_members_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1261 ALTER TABLE ONLY current_relation_members
1262 ADD CONSTRAINT current_relation_members_pkey PRIMARY KEY (relation_id, member_type, member_id, member_role, sequence_id);
1266 -- Name: current_relation_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1269 ALTER TABLE ONLY current_relation_tags
1270 ADD CONSTRAINT current_relation_tags_pkey PRIMARY KEY (relation_id, k);
1274 -- Name: current_relations_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1277 ALTER TABLE ONLY current_relations
1278 ADD CONSTRAINT current_relations_pkey PRIMARY KEY (id);
1282 -- Name: current_way_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1285 ALTER TABLE ONLY current_way_nodes
1286 ADD CONSTRAINT current_way_nodes_pkey PRIMARY KEY (way_id, sequence_id);
1290 -- Name: current_way_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1293 ALTER TABLE ONLY current_way_tags
1294 ADD CONSTRAINT current_way_tags_pkey PRIMARY KEY (way_id, k);
1298 -- Name: current_ways_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1301 ALTER TABLE ONLY current_ways
1302 ADD CONSTRAINT current_ways_pkey PRIMARY KEY (id);
1306 -- Name: diary_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1309 ALTER TABLE ONLY diary_comments
1310 ADD CONSTRAINT diary_comments_pkey PRIMARY KEY (id);
1314 -- Name: diary_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1317 ALTER TABLE ONLY diary_entries
1318 ADD CONSTRAINT diary_entries_pkey PRIMARY KEY (id);
1322 -- Name: friends_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1325 ALTER TABLE ONLY friends
1326 ADD CONSTRAINT friends_pkey PRIMARY KEY (id);
1330 -- Name: gpx_file_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1333 ALTER TABLE ONLY gpx_file_tags
1334 ADD CONSTRAINT gpx_file_tags_pkey PRIMARY KEY (id);
1338 -- Name: gpx_files_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1341 ALTER TABLE ONLY gpx_files
1342 ADD CONSTRAINT gpx_files_pkey PRIMARY KEY (id);
1346 -- Name: languages_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1349 ALTER TABLE ONLY languages
1350 ADD CONSTRAINT languages_pkey PRIMARY KEY (code);
1354 -- Name: messages_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1357 ALTER TABLE ONLY messages
1358 ADD CONSTRAINT messages_pkey PRIMARY KEY (id);
1362 -- Name: node_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1365 ALTER TABLE ONLY node_tags
1366 ADD CONSTRAINT node_tags_pkey PRIMARY KEY (node_id, version, k);
1370 -- Name: nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1373 ALTER TABLE ONLY nodes
1374 ADD CONSTRAINT nodes_pkey PRIMARY KEY (node_id, version);
1378 -- Name: oauth_nonces_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1381 ALTER TABLE ONLY oauth_nonces
1382 ADD CONSTRAINT oauth_nonces_pkey PRIMARY KEY (id);
1386 -- Name: oauth_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1389 ALTER TABLE ONLY oauth_tokens
1390 ADD CONSTRAINT oauth_tokens_pkey PRIMARY KEY (id);
1394 -- Name: redactions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1397 ALTER TABLE ONLY redactions
1398 ADD CONSTRAINT redactions_pkey PRIMARY KEY (id);
1402 -- Name: relation_members_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1405 ALTER TABLE ONLY relation_members
1406 ADD CONSTRAINT relation_members_pkey PRIMARY KEY (relation_id, version, member_type, member_id, member_role, sequence_id);
1410 -- Name: relation_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1413 ALTER TABLE ONLY relation_tags
1414 ADD CONSTRAINT relation_tags_pkey PRIMARY KEY (relation_id, version, k);
1418 -- Name: relations_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1421 ALTER TABLE ONLY relations
1422 ADD CONSTRAINT relations_pkey PRIMARY KEY (relation_id, version);
1426 -- Name: user_blocks_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1429 ALTER TABLE ONLY user_blocks
1430 ADD CONSTRAINT user_blocks_pkey PRIMARY KEY (id);
1434 -- Name: user_preferences_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1437 ALTER TABLE ONLY user_preferences
1438 ADD CONSTRAINT user_preferences_pkey PRIMARY KEY (user_id, k);
1442 -- Name: user_roles_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1445 ALTER TABLE ONLY user_roles
1446 ADD CONSTRAINT user_roles_pkey PRIMARY KEY (id);
1450 -- Name: user_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1453 ALTER TABLE ONLY user_tokens
1454 ADD CONSTRAINT user_tokens_pkey PRIMARY KEY (id);
1458 -- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1461 ALTER TABLE ONLY users
1462 ADD CONSTRAINT users_pkey PRIMARY KEY (id);
1466 -- Name: way_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1469 ALTER TABLE ONLY way_nodes
1470 ADD CONSTRAINT way_nodes_pkey PRIMARY KEY (way_id, version, sequence_id);
1474 -- Name: way_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1477 ALTER TABLE ONLY way_tags
1478 ADD CONSTRAINT way_tags_pkey PRIMARY KEY (way_id, version, k);
1482 -- Name: ways_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
1485 ALTER TABLE ONLY ways
1486 ADD CONSTRAINT ways_pkey PRIMARY KEY (way_id, version);
1490 -- Name: acls_k_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1493 CREATE INDEX acls_k_idx ON acls USING btree (k);
1497 -- Name: changeset_tags_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1500 CREATE INDEX changeset_tags_id_idx ON changeset_tags USING btree (changeset_id);
1504 -- Name: changesets_bbox_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1507 CREATE INDEX changesets_bbox_idx ON changesets USING gist (min_lat, max_lat, min_lon, max_lon);
1511 -- Name: changesets_closed_at_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1514 CREATE INDEX changesets_closed_at_idx ON changesets USING btree (closed_at);
1518 -- Name: changesets_created_at_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1521 CREATE INDEX changesets_created_at_idx ON changesets USING btree (created_at);
1525 -- Name: changesets_user_id_created_at_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1528 CREATE INDEX changesets_user_id_created_at_idx ON changesets USING btree (user_id, created_at);
1532 -- Name: changesets_user_id_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1535 CREATE INDEX changesets_user_id_id_idx ON changesets USING btree (user_id, id);
1539 -- Name: countries_code_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1542 CREATE UNIQUE INDEX countries_code_idx ON countries USING btree (code);
1546 -- Name: current_nodes_tile_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1549 CREATE INDEX current_nodes_tile_idx ON current_nodes USING btree (tile);
1553 -- Name: current_nodes_timestamp_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1556 CREATE INDEX current_nodes_timestamp_idx ON current_nodes USING btree ("timestamp");
1560 -- Name: current_relation_members_member_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1563 CREATE INDEX current_relation_members_member_idx ON current_relation_members USING btree (member_type, member_id);
1567 -- Name: current_relations_timestamp_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1570 CREATE INDEX current_relations_timestamp_idx ON current_relations USING btree ("timestamp");
1574 -- Name: current_way_nodes_node_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1577 CREATE INDEX current_way_nodes_node_idx ON current_way_nodes USING btree (node_id);
1581 -- Name: current_ways_timestamp_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1584 CREATE INDEX current_ways_timestamp_idx ON current_ways USING btree ("timestamp");
1588 -- Name: diary_comment_user_id_created_at_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
1591 CREATE INDEX diary_comment_user_id_created_at_index ON diary_comments USING btree (user_id, created_at);
1595 -- Name: diary_comments_entry_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1598 CREATE UNIQUE INDEX diary_comments_entry_id_idx ON diary_comments USING btree (diary_entry_id, id);
1602 -- Name: diary_entry_created_at_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
1605 CREATE INDEX diary_entry_created_at_index ON diary_entries USING btree (created_at);
1609 -- Name: diary_entry_language_code_created_at_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
1612 CREATE INDEX diary_entry_language_code_created_at_index ON diary_entries USING btree (language_code, created_at);
1616 -- Name: diary_entry_user_id_created_at_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
1619 CREATE INDEX diary_entry_user_id_created_at_index ON diary_entries USING btree (user_id, created_at);
1623 -- Name: friends_user_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1626 CREATE INDEX friends_user_id_idx ON friends USING btree (user_id);
1630 -- Name: gpx_file_tags_gpxid_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1633 CREATE INDEX gpx_file_tags_gpxid_idx ON gpx_file_tags USING btree (gpx_id);
1637 -- Name: gpx_file_tags_tag_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1640 CREATE INDEX gpx_file_tags_tag_idx ON gpx_file_tags USING btree (tag);
1644 -- Name: gpx_files_timestamp_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1647 CREATE INDEX gpx_files_timestamp_idx ON gpx_files USING btree ("timestamp");
1651 -- Name: gpx_files_user_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1654 CREATE INDEX gpx_files_user_id_idx ON gpx_files USING btree (user_id);
1658 -- Name: gpx_files_visible_visibility_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1661 CREATE INDEX gpx_files_visible_visibility_idx ON gpx_files USING btree (visible, visibility);
1665 -- Name: index_client_applications_on_key; Type: INDEX; Schema: public; Owner: -; Tablespace:
1668 CREATE UNIQUE INDEX index_client_applications_on_key ON client_applications USING btree (key);
1672 -- Name: index_oauth_nonces_on_nonce_and_timestamp; Type: INDEX; Schema: public; Owner: -; Tablespace:
1675 CREATE UNIQUE INDEX index_oauth_nonces_on_nonce_and_timestamp ON oauth_nonces USING btree (nonce, "timestamp");
1679 -- Name: index_oauth_tokens_on_token; Type: INDEX; Schema: public; Owner: -; Tablespace:
1682 CREATE UNIQUE INDEX index_oauth_tokens_on_token ON oauth_tokens USING btree (token);
1686 -- Name: index_user_blocks_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
1689 CREATE INDEX index_user_blocks_on_user_id ON user_blocks USING btree (user_id);
1693 -- Name: messages_from_user_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1696 CREATE INDEX messages_from_user_id_idx ON messages USING btree (from_user_id);
1700 -- Name: messages_to_user_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1703 CREATE INDEX messages_to_user_id_idx ON messages USING btree (to_user_id);
1707 -- Name: nodes_changeset_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1710 CREATE INDEX nodes_changeset_id_idx ON nodes USING btree (changeset_id);
1714 -- Name: nodes_tile_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1717 CREATE INDEX nodes_tile_idx ON nodes USING btree (tile);
1721 -- Name: nodes_timestamp_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1724 CREATE INDEX nodes_timestamp_idx ON nodes USING btree ("timestamp");
1728 -- Name: points_gpxid_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1731 CREATE INDEX points_gpxid_idx ON gps_points USING btree (gpx_id);
1735 -- Name: points_tile_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1738 CREATE INDEX points_tile_idx ON gps_points USING btree (tile);
1742 -- Name: relation_members_member_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1745 CREATE INDEX relation_members_member_idx ON relation_members USING btree (member_type, member_id);
1749 -- Name: relations_changeset_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1752 CREATE INDEX relations_changeset_id_idx ON relations USING btree (changeset_id);
1756 -- Name: relations_timestamp_idx; Type: INDEX; Schema: public; Owner: -; Tablespace:
1759 CREATE INDEX relations_timestamp_idx ON relations USING btree ("timestamp");
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: nodes_redaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2057 ALTER TABLE ONLY nodes
2058 ADD CONSTRAINT nodes_redaction_id_fkey FOREIGN KEY (redaction_id) REFERENCES redactions(id);
2062 -- Name: oauth_tokens_client_application_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2065 ALTER TABLE ONLY oauth_tokens
2066 ADD CONSTRAINT oauth_tokens_client_application_id_fkey FOREIGN KEY (client_application_id) REFERENCES client_applications(id);
2070 -- Name: oauth_tokens_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2073 ALTER TABLE ONLY oauth_tokens
2074 ADD CONSTRAINT oauth_tokens_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2078 -- Name: redactions_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2081 ALTER TABLE ONLY redactions
2082 ADD CONSTRAINT redactions_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2086 -- Name: relation_members_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2089 ALTER TABLE ONLY relation_members
2090 ADD CONSTRAINT relation_members_id_fkey FOREIGN KEY (relation_id, version) REFERENCES relations(relation_id, version);
2094 -- Name: relation_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2097 ALTER TABLE ONLY relation_tags
2098 ADD CONSTRAINT relation_tags_id_fkey FOREIGN KEY (relation_id, version) REFERENCES relations(relation_id, version);
2102 -- Name: relations_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2105 ALTER TABLE ONLY relations
2106 ADD CONSTRAINT relations_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2110 -- Name: relations_redaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2113 ALTER TABLE ONLY relations
2114 ADD CONSTRAINT relations_redaction_id_fkey FOREIGN KEY (redaction_id) REFERENCES redactions(id);
2118 -- Name: user_blocks_moderator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2121 ALTER TABLE ONLY user_blocks
2122 ADD CONSTRAINT user_blocks_moderator_id_fkey FOREIGN KEY (creator_id) REFERENCES users(id);
2126 -- Name: user_blocks_revoker_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2129 ALTER TABLE ONLY user_blocks
2130 ADD CONSTRAINT user_blocks_revoker_id_fkey FOREIGN KEY (revoker_id) REFERENCES users(id);
2134 -- Name: user_blocks_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2137 ALTER TABLE ONLY user_blocks
2138 ADD CONSTRAINT user_blocks_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2142 -- Name: user_preferences_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2145 ALTER TABLE ONLY user_preferences
2146 ADD CONSTRAINT user_preferences_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2150 -- Name: user_roles_granter_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2153 ALTER TABLE ONLY user_roles
2154 ADD CONSTRAINT user_roles_granter_id_fkey FOREIGN KEY (granter_id) REFERENCES users(id);
2158 -- Name: user_roles_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2161 ALTER TABLE ONLY user_roles
2162 ADD CONSTRAINT user_roles_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2166 -- Name: user_tokens_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2169 ALTER TABLE ONLY user_tokens
2170 ADD CONSTRAINT user_tokens_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
2174 -- Name: way_nodes_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2177 ALTER TABLE ONLY way_nodes
2178 ADD CONSTRAINT way_nodes_id_fkey FOREIGN KEY (way_id, version) REFERENCES ways(way_id, version);
2182 -- Name: way_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2185 ALTER TABLE ONLY way_tags
2186 ADD CONSTRAINT way_tags_id_fkey FOREIGN KEY (way_id, version) REFERENCES ways(way_id, version);
2190 -- Name: ways_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2193 ALTER TABLE ONLY ways
2194 ADD CONSTRAINT ways_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES changesets(id);
2198 -- Name: ways_redaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2201 ALTER TABLE ONLY ways
2202 ADD CONSTRAINT ways_redaction_id_fkey FOREIGN KEY (redaction_id) REFERENCES redactions(id);
2206 -- PostgreSQL database dump complete
2209 INSERT INTO schema_migrations (version) VALUES ('1');
2211 INSERT INTO schema_migrations (version) VALUES ('10');
2213 INSERT INTO schema_migrations (version) VALUES ('11');
2215 INSERT INTO schema_migrations (version) VALUES ('12');
2217 INSERT INTO schema_migrations (version) VALUES ('13');
2219 INSERT INTO schema_migrations (version) VALUES ('14');
2221 INSERT INTO schema_migrations (version) VALUES ('15');
2223 INSERT INTO schema_migrations (version) VALUES ('16');
2225 INSERT INTO schema_migrations (version) VALUES ('17');
2227 INSERT INTO schema_migrations (version) VALUES ('18');
2229 INSERT INTO schema_migrations (version) VALUES ('19');
2231 INSERT INTO schema_migrations (version) VALUES ('2');
2233 INSERT INTO schema_migrations (version) VALUES ('20');
2235 INSERT INTO schema_migrations (version) VALUES ('20100513171259');
2237 INSERT INTO schema_migrations (version) VALUES ('20100516124737');
2239 INSERT INTO schema_migrations (version) VALUES ('20100910084426');
2241 INSERT INTO schema_migrations (version) VALUES ('20101114011429');
2243 INSERT INTO schema_migrations (version) VALUES ('20110322001319');
2245 INSERT INTO schema_migrations (version) VALUES ('20110925112722');
2247 INSERT INTO schema_migrations (version) VALUES ('20111116184519');
2249 INSERT INTO schema_migrations (version) VALUES ('20111212183945');
2251 INSERT INTO schema_migrations (version) VALUES ('20120123184321');
2253 INSERT INTO schema_migrations (version) VALUES ('20120208122334');
2255 INSERT INTO schema_migrations (version) VALUES ('20120208194454');
2257 INSERT INTO schema_migrations (version) VALUES ('20120214210114');
2259 INSERT INTO schema_migrations (version) VALUES ('20120219161649');
2261 INSERT INTO schema_migrations (version) VALUES ('20120318201948');
2263 INSERT INTO schema_migrations (version) VALUES ('20120328090602');
2265 INSERT INTO schema_migrations (version) VALUES ('20120404205604');
2267 INSERT INTO schema_migrations (version) VALUES ('20120808231205');
2269 INSERT INTO schema_migrations (version) VALUES ('21');
2271 INSERT INTO schema_migrations (version) VALUES ('22');
2273 INSERT INTO schema_migrations (version) VALUES ('23');
2275 INSERT INTO schema_migrations (version) VALUES ('24');
2277 INSERT INTO schema_migrations (version) VALUES ('25');
2279 INSERT INTO schema_migrations (version) VALUES ('26');
2281 INSERT INTO schema_migrations (version) VALUES ('27');
2283 INSERT INTO schema_migrations (version) VALUES ('28');
2285 INSERT INTO schema_migrations (version) VALUES ('29');
2287 INSERT INTO schema_migrations (version) VALUES ('3');
2289 INSERT INTO schema_migrations (version) VALUES ('30');
2291 INSERT INTO schema_migrations (version) VALUES ('31');
2293 INSERT INTO schema_migrations (version) VALUES ('32');
2295 INSERT INTO schema_migrations (version) VALUES ('33');
2297 INSERT INTO schema_migrations (version) VALUES ('34');
2299 INSERT INTO schema_migrations (version) VALUES ('35');
2301 INSERT INTO schema_migrations (version) VALUES ('36');
2303 INSERT INTO schema_migrations (version) VALUES ('37');
2305 INSERT INTO schema_migrations (version) VALUES ('38');
2307 INSERT INTO schema_migrations (version) VALUES ('39');
2309 INSERT INTO schema_migrations (version) VALUES ('4');
2311 INSERT INTO schema_migrations (version) VALUES ('40');
2313 INSERT INTO schema_migrations (version) VALUES ('41');
2315 INSERT INTO schema_migrations (version) VALUES ('42');
2317 INSERT INTO schema_migrations (version) VALUES ('43');
2319 INSERT INTO schema_migrations (version) VALUES ('44');
2321 INSERT INTO schema_migrations (version) VALUES ('45');
2323 INSERT INTO schema_migrations (version) VALUES ('46');
2325 INSERT INTO schema_migrations (version) VALUES ('47');
2327 INSERT INTO schema_migrations (version) VALUES ('48');
2329 INSERT INTO schema_migrations (version) VALUES ('49');
2331 INSERT INTO schema_migrations (version) VALUES ('5');
2333 INSERT INTO schema_migrations (version) VALUES ('50');
2335 INSERT INTO schema_migrations (version) VALUES ('51');
2337 INSERT INTO schema_migrations (version) VALUES ('52');
2339 INSERT INTO schema_migrations (version) VALUES ('6');
2341 INSERT INTO schema_migrations (version) VALUES ('7');
2343 INSERT INTO schema_migrations (version) VALUES ('8');
2345 INSERT INTO schema_migrations (version) VALUES ('9');