+-- Name: messages_to_user_id_idx; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX messages_to_user_id_idx ON public.messages USING btree (to_user_id);
+
+
+--
+-- Name: nodes_changeset_id_idx; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX nodes_changeset_id_idx ON public.nodes USING btree (changeset_id);
+
+
+--
+-- Name: nodes_tile_idx; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX nodes_tile_idx ON public.nodes USING btree (tile);
+
+
+--
+-- Name: nodes_timestamp_idx; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX nodes_timestamp_idx ON public.nodes USING btree ("timestamp");
+
+
+--
+-- Name: note_comments_note_id_idx; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX note_comments_note_id_idx ON public.note_comments USING btree (note_id);
+
+
+--
+-- Name: notes_created_at_idx; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX notes_created_at_idx ON public.notes USING btree (created_at);
+
+
+--
+-- Name: notes_tile_status_idx; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX notes_tile_status_idx ON public.notes USING btree (tile, status);
+
+
+--
+-- Name: notes_updated_at_idx; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX notes_updated_at_idx ON public.notes USING btree (updated_at);
+
+
+--
+-- Name: points_gpxid_idx; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX points_gpxid_idx ON public.gps_points USING btree (gpx_id);
+
+
+--
+-- Name: points_tile_idx; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX points_tile_idx ON public.gps_points USING btree (tile);
+
+
+--
+-- Name: relation_members_member_idx; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX relation_members_member_idx ON public.relation_members USING btree (member_type, member_id);
+
+
+--
+-- Name: relations_changeset_id_idx; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX relations_changeset_id_idx ON public.relations USING btree (changeset_id);
+
+
+--
+-- Name: relations_timestamp_idx; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX relations_timestamp_idx ON public.relations USING btree ("timestamp");
+
+
+--
+-- Name: user_id_idx; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX user_id_idx ON public.friends USING btree (friend_user_id);
+
+
+--
+-- Name: user_roles_id_role_unique; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX user_roles_id_role_unique ON public.user_roles USING btree (user_id, role);
+
+
+--
+-- Name: users_auth_idx; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX users_auth_idx ON public.users USING btree (auth_provider, auth_uid);
+
+
+--
+-- Name: users_display_name_canonical_idx; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX users_display_name_canonical_idx ON public.users USING btree (lower(NORMALIZE(display_name, NFKC)));
+
+
+--
+-- Name: users_display_name_idx; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX users_display_name_idx ON public.users USING btree (display_name);
+
+
+--
+-- Name: users_email_idx; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX users_email_idx ON public.users USING btree (email);
+
+
+--
+-- Name: users_email_lower_idx; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX users_email_lower_idx ON public.users USING btree (lower((email)::text));
+
+
+--
+-- Name: users_home_idx; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX users_home_idx ON public.users USING btree (home_tile);
+
+
+--
+-- Name: way_nodes_node_idx; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX way_nodes_node_idx ON public.way_nodes USING btree (node_id);
+
+
+--
+-- Name: ways_changeset_id_idx; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX ways_changeset_id_idx ON public.ways USING btree (changeset_id);
+
+
+--
+-- Name: ways_timestamp_idx; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX ways_timestamp_idx ON public.ways USING btree ("timestamp");
+
+
+--
+-- Name: changeset_comments changeset_comments_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.changeset_comments
+ ADD CONSTRAINT changeset_comments_author_id_fkey FOREIGN KEY (author_id) REFERENCES public.users(id);
+
+
+--
+-- Name: changeset_comments changeset_comments_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.changeset_comments
+ ADD CONSTRAINT changeset_comments_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES public.changesets(id);
+
+
+--
+-- Name: changeset_tags changeset_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.changeset_tags
+ ADD CONSTRAINT changeset_tags_id_fkey FOREIGN KEY (changeset_id) REFERENCES public.changesets(id);
+
+
+--
+-- Name: changesets_subscribers changesets_subscribers_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.changesets_subscribers
+ ADD CONSTRAINT changesets_subscribers_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES public.changesets(id);
+
+
+--
+-- Name: changesets_subscribers changesets_subscribers_subscriber_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.changesets_subscribers
+ ADD CONSTRAINT changesets_subscribers_subscriber_id_fkey FOREIGN KEY (subscriber_id) REFERENCES public.users(id);
+
+
+--
+-- Name: changesets changesets_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.changesets
+ ADD CONSTRAINT changesets_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);
+
+
+--
+-- Name: current_node_tags current_node_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.current_node_tags
+ ADD CONSTRAINT current_node_tags_id_fkey FOREIGN KEY (node_id) REFERENCES public.current_nodes(id);
+
+
+--
+-- Name: current_nodes current_nodes_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.current_nodes
+ ADD CONSTRAINT current_nodes_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES public.changesets(id);
+
+
+--
+-- Name: current_relation_members current_relation_members_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.current_relation_members
+ ADD CONSTRAINT current_relation_members_id_fkey FOREIGN KEY (relation_id) REFERENCES public.current_relations(id);
+
+
+--
+-- Name: current_relation_tags current_relation_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.current_relation_tags
+ ADD CONSTRAINT current_relation_tags_id_fkey FOREIGN KEY (relation_id) REFERENCES public.current_relations(id);
+
+
+--
+-- Name: current_relations current_relations_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.current_relations
+ ADD CONSTRAINT current_relations_changeset_id_fkey FOREIGN KEY (changeset_id) REFERENCES public.changesets(id);
+
+
+--
+-- Name: current_way_nodes current_way_nodes_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -