Skip to content

Commit 589453d

Browse files
Gargronhiyuki2578
authored andcommitted
Fix older migrations not working due to new default scope (mastodon#11983)
Fix mastodon#11952, regression from mastodon#11623
1 parent 4e8ff00 commit 589453d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

db/migrate/20161202132159_add_in_reply_to_account_id_to_statuses.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ def up
33
add_column :statuses, :in_reply_to_account_id, :integer, null: true, default: nil
44

55
ActiveRecord::Base.transaction do
6-
Status.where.not(in_reply_to_id: nil).includes(:thread).find_each do |status|
6+
Status.unscoped.where.not(in_reply_to_id: nil).includes(:thread).find_each do |status|
77
next if status.thread.nil?
88

99
status.in_reply_to_account_id = status.thread.account_id

db/migrate/20170209184350_add_reply_to_statuses.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
class AddReplyToStatuses < ActiveRecord::Migration[5.0]
22
def up
33
add_column :statuses, :reply, :boolean, nil: false, default: false
4-
Status.update_all('reply = (in_reply_to_id IS NOT NULL)')
4+
Status.unscoped.update_all('reply = (in_reply_to_id IS NOT NULL)')
55
end
66

77
def down

0 commit comments

Comments
 (0)