Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
Fix migration 20200407202420_migrate_unavailable_inboxes (mastodon#13481
Browse files Browse the repository at this point in the history
)
  • Loading branch information
noellabo authored Apr 16, 2020
1 parent 3825e19 commit ea200a1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions db/migrate/20200407202420_migrate_unavailable_inboxes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ class MigrateUnavailableInboxes < ActiveRecord::Migration[5.2]
def up
urls = Redis.current.smembers('unavailable_inboxes')

urls.each do |url|
host = Addressable::URI.parse(url).normalized_host
hosts = urls.map do |url|
Addressable::URI.parse(url).normalized_host
end.compact.uniq

UnavailableDomain.delete_all

hosts.each do |host|
UnavailableDomain.create(domain: host)
end

Expand Down

0 comments on commit ea200a1

Please sign in to comment.