Merge commit '121443c0fca383268b8022c048dd137994785aff' into glitch-soc/main
Conflicts: - `.rubocop_todo.yml`: Upstream regenerated this file, glitch-soc had a specific ignore.
This commit is contained in:
@@ -3,8 +3,15 @@
|
||||
class FillAccountSuspensionOrigin < ActiveRecord::Migration[5.2]
|
||||
disable_ddl_transaction!
|
||||
|
||||
class MigrationAccount < ApplicationRecord
|
||||
self.table_name = :accounts
|
||||
scope :suspended, -> { where.not(suspended_at: nil) }
|
||||
enum suspension_origin: { local: 0, remote: 1 }, _prefix: true
|
||||
end
|
||||
|
||||
def up
|
||||
Account.suspended.where(suspension_origin: nil).in_batches.update_all(suspension_origin: :local)
|
||||
MigrationAccount.reset_column_information
|
||||
MigrationAccount.suspended.where(suspension_origin: nil).in_batches.update_all(suspension_origin: :local)
|
||||
end
|
||||
|
||||
def down; end
|
||||
|
@@ -18,7 +18,7 @@ class AddUniqueIndexOnPreviewCardsStatuses < ActiveRecord::Migration[6.1]
|
||||
def deduplicate_and_reindex!
|
||||
deduplicate_preview_cards!
|
||||
|
||||
safety_assured { execute 'REINDEX INDEX preview_cards_statuses_pkey' }
|
||||
safety_assured { execute 'REINDEX INDEX CONCURRENTLY preview_cards_statuses_pkey' }
|
||||
rescue ActiveRecord::RecordNotUnique
|
||||
retry
|
||||
end
|
||||
|
Reference in New Issue
Block a user