mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-09 08:25:55 +00:00
Fix weird edge case in load_schema
This commit is contained in:
parent
6b999411fc
commit
e87cc59811
|
@ -24,7 +24,7 @@ module ActiveRecord
|
||||||
# We have a set of allowed duplicates. Keep the migrated one, if any.
|
# We have a set of allowed duplicates. Keep the migrated one, if any.
|
||||||
non_migrated = duplicates.reject { |m| migrated.include?(m.version.to_i) }
|
non_migrated = duplicates.reject { |m| migrated.include?(m.version.to_i) }
|
||||||
|
|
||||||
if duplicates.length == non_migrated.length
|
if duplicates.length == non_migrated.length || non_migrated.length == 0
|
||||||
# There weren't any migrated one, so we have to pick one “canonical” migration
|
# There weren't any migrated one, so we have to pick one “canonical” migration
|
||||||
migrations = migrations - duplicates[1..-1]
|
migrations = migrations - duplicates[1..-1]
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue