X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/3e99bbf5a9e124a59fc5ae72c863e89af7fa8c46..bf9430f43ecfe1f99b6b0883e5c1b442ff47333f:/db/migrate/024_order_relation_members.rb?ds=sidebyside diff --git a/db/migrate/024_order_relation_members.rb b/db/migrate/024_order_relation_members.rb index 325be5174..c2a3ada32 100644 --- a/db/migrate/024_order_relation_members.rb +++ b/db/migrate/024_order_relation_members.rb @@ -1,18 +1,18 @@ -require 'migrate' +require "migrate" -class OrderRelationMembers < ActiveRecord::Migration +class OrderRelationMembers < ActiveRecord::Migration[4.2] def self.up # add sequence column. rails won't let us define an ordering here, # as defaults must be constant. add_column(:relation_members, :sequence_id, :integer, :default => 0, :null => false) - # update the sequence column with default (partial) ordering by + # update the sequence column with default (partial) ordering by # element ID. the sequence ID is a smaller int type, so we can't # just copy the member_id. execute("update relation_members set sequence_id = mod(member_id, 16384)") - # need to update the primary key to include the sequence number, + # need to update the primary key to include the sequence number, # otherwise the primary key will barf when we have repeated members. # mysql barfs on this anyway, so we need a single command. this may # not work in postgres... needs testing.