Make AddHideNotificationsToMute Concurrent

It's not clear how much this will benefit instances in practice, as the
number of mutes tends to be pretty small, but this should prevent any
blocking migrations nonetheless.
pull/195/head
aschmitz 2017-10-22 20:51:07 -05:00
parent 6b70c2ca12
commit 0e210b5c63
1 changed files with 10 additions and 2 deletions

View File

@ -1,5 +1,13 @@
class AddHideNotificationsToMute < ActiveRecord::Migration[5.1]
def change
add_column :mutes, :hide_notifications, :boolean, default: true, null: false
include Mastodon::MigrationHelpers
disable_ddl_transaction!
def up
add_column_with_default :mutes, :hide_notifications, :boolean, default: true, allow_null: false
end
def down
remove_column :mutes, :hide_notifications
end
end