Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a geometry index to project_nodes, and ensure various other combo…
…s are unique.
- Loading branch information
1 parent
a857d21
commit 988bd56
Showing
2 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
class AddMoreIndexes < ActiveRecord::Migration | ||
def change | ||
add_index :project_nodes, :geom, spatial: true | ||
add_index :project_nodes, [:project_id, :osm_id], unique: true | ||
add_index :project_way_nodes, [:project_id, :way_id, :sequence_id], | ||
unique: true, name: "index_project_way_nodes_on_project_way_seq_ids" | ||
add_index :project_ways, [:project_id, :osm_id], unique: true | ||
add_index :project_relation_members, [:project_id, :relation_id, :sequence_id], | ||
unique: true, name: "index_project_relation_members_on_project_rel_seq_ids" | ||
add_index :project_relations, [:project_id, :osm_id], unique: true | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters