mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-08-18 22:14:46 +00:00
* Fix null values being included in some indexes * Update lib/mastodon/migration_helpers.rb Co-authored-by: Claire <claire.github-309c@sitedethib.com> * Add documentation link to corruption error message Co-authored-by: Claire <claire.github-309c@sitedethib.com>
18 lines
513 B
Ruby
18 lines
513 B
Ruby
# frozen_string_literal: true
|
|
|
|
require Rails.root.join('lib', 'mastodon', 'migration_helpers')
|
|
|
|
class OptimizeNullIndexAppealsRejectedByAccountId < ActiveRecord::Migration[5.2]
|
|
include Mastodon::MigrationHelpers
|
|
|
|
disable_ddl_transaction!
|
|
|
|
def up
|
|
update_index :appeals, 'index_appeals_on_rejected_by_account_id', :rejected_by_account_id, where: 'rejected_by_account_id IS NOT NULL'
|
|
end
|
|
|
|
def down
|
|
update_index :appeals, 'index_appeals_on_rejected_by_account_id', :rejected_by_account_id
|
|
end
|
|
end
|