]> git.openstreetmap.org Git - rails.git/blob - db/migrate/20231010194809_correct_relation_members_primary_key.rb
Remove extraneous fields from primary keys for relation members
[rails.git] / db / migrate / 20231010194809_correct_relation_members_primary_key.rb
1 class CorrectRelationMembersPrimaryKey < ActiveRecord::Migration[7.0]
2   def up
3     alter_primary_key :current_relation_members, [:relation_id, :sequence_id]
4     alter_primary_key :relation_members, [:relation_id, :version, :sequence_id]
5   end
6
7   def down
8     alter_primary_key :relation_members, [:relation_id, :version, :member_type, :member_id, :member_role, :sequence_id]
9     alter_primary_key :current_relation_members, [:relation_id, :member_type, :member_id, :member_role, :sequence_id]
10   end
11 end