mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
![Eugen Rochko](/assets/img/avatar_default.png)
* 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
545 B
Ruby
18 lines
545 B
Ruby
# frozen_string_literal: true
|
|
|
|
require Rails.root.join('lib', 'mastodon', 'migration_helpers')
|
|
|
|
class OptimizeNullIndexWebPushSubscriptionsAccessTokenId < ActiveRecord::Migration[5.2]
|
|
include Mastodon::MigrationHelpers
|
|
|
|
disable_ddl_transaction!
|
|
|
|
def up
|
|
update_index :web_push_subscriptions, 'index_web_push_subscriptions_on_access_token_id', :access_token_id, where: 'access_token_id IS NOT NULL'
|
|
end
|
|
|
|
def down
|
|
update_index :web_push_subscriptions, 'index_web_push_subscriptions_on_access_token_id', :access_token_id
|
|
end
|
|
end
|