chinwagsocial/db/migrate/20190306145741_add_lock_version_to_polls.rb
ThibG 96f905f409 Add optimistic lock to avoid race conditions when handling votes (#10196)
* Add optimistic lock to avoid race conditions when handling votes

* Force-reload polls when getting `ActiveRecord::StaleObjectError`
2019-03-06 19:53:57 +01:00

7 lines
155 B
Ruby

class AddLockVersionToPolls < ActiveRecord::Migration[5.2]
def change
add_column :polls, :lock_version, :integer, null: false, default: 0
end
end