Fix account counters being overwritten by parallel writes (#12045)
This commit is contained in:
parent
9e3e3fa5ee
commit
62f60e86c2
4 changed files with 92 additions and 1 deletions
|
@ -0,0 +1,15 @@
|
|||
require Rails.root.join('lib', 'mastodon', 'migration_helpers')
|
||||
|
||||
class AddLockVersionToAccountStats < ActiveRecord::Migration[5.2]
|
||||
include Mastodon::MigrationHelpers
|
||||
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
safety_assured { add_column_with_default :account_stats, :lock_version, :integer, allow_null: false, default: 0 }
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :account_stats, :lock_version
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue