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.
Remove extraneous fields from primary keys for relation members
- Loading branch information
Showing
2 changed files
with
14 additions
and
2 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
db/migrate/20231010194809_correct_relation_members_primary_key.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,11 @@ | ||
class CorrectRelationMembersPrimaryKey < ActiveRecord::Migration[7.0] | ||
def up | ||
alter_primary_key :current_relation_members, [:relation_id, :sequence_id] | ||
alter_primary_key :relation_members, [:relation_id, :version, :sequence_id] | ||
end | ||
|
||
def down | ||
alter_primary_key :relation_members, [:relation_id, :version, :member_type, :member_id, :member_role, :sequence_id] | ||
alter_primary_key :current_relation_members, [:relation_id, :member_type, :member_id, :member_role, :sequence_id] | ||
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