forked from openstreetmap/openstreetmap-website
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request openstreetmap#4279 from tomhughes/changeset-tags-p…
…rimary-key Add a primary key to the changeset_tags table
- Loading branch information
Showing
3 changed files
with
51 additions
and
20 deletions.
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
13 changes: 13 additions & 0 deletions
13
db/migrate/20231007141103_add_primary_key_to_changeset_tags.rb
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,13 @@ | ||
class AddPrimaryKeyToChangesetTags < ActiveRecord::Migration[7.0] | ||
disable_ddl_transaction! | ||
|
||
def up | ||
add_primary_key :changeset_tags, [:changeset_id, :k], :algorithm => :concurrently | ||
remove_index :changeset_tags, [:changeset_id] | ||
end | ||
|
||
def down | ||
add_index :changeset_tags, [:changeset_id], :algorithm => :concurrently | ||
remove_primary_key :changeset_tags | ||
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