mirror of
https://github.com/discourse/discourse.git
synced 2024-12-05 10:15:47 +08:00
7 lines
265 B
Ruby
7 lines
265 B
Ruby
class AddPositionToUserFields < ActiveRecord::Migration[4.2]
|
|
def change
|
|
add_column :user_fields, :position, :integer, default: 0
|
|
execute "UPDATE user_fields SET position = (SELECT COUNT(*) from user_fields as uf2 where uf2.id < user_fields.id)"
|
|
end
|
|
end
|