mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 23:06:19 +08:00
FEATURE: posts:rebake_uncooked_posts to look at mismatching baked_version
also amends flagging onebox updates to set baked_version to nil
This commit is contained in:
parent
4f296608da
commit
73f178a634
|
@ -8,7 +8,7 @@ task 'posts:rebake' => :environment do
|
|||
end
|
||||
|
||||
task 'posts:rebake_uncooked_posts' => :environment do
|
||||
uncooked = Post.where(baked_version: nil)
|
||||
uncooked = Post.where('baked_version <> ? or baked_version IS NULL', Post::BAKED_VERSION)
|
||||
|
||||
rebaked = 0
|
||||
total = uncooked.count
|
||||
|
|
|
@ -243,7 +243,7 @@ def migration_successful?(db, should_raise = false)
|
|||
raise "rake posts:missing_uploads identified #{count} issues. #{failure_message}" if count > 0 && should_raise
|
||||
success &&= count == 0
|
||||
|
||||
count = Post.where('baked_version <> ?', Post::BAKED_VERSION).count
|
||||
count = Post.where('baked_version <> ? OR baked_version IS NULL', Post::BAKED_VERSION).count
|
||||
if count > 0
|
||||
puts "No posts require rebaking"
|
||||
else
|
||||
|
@ -498,7 +498,7 @@ def migrate_to_s3
|
|||
|
||||
puts "Flagging all posts containing oneboxes for rebake..."
|
||||
|
||||
count = Post.where("cooked LIKE '%class=\"lightbox\"%'").update_all(baked_version: Post::BAKED_VERSION - 1)
|
||||
count = Post.where("cooked LIKE '%class=\"lightbox\"%'").update_all(baked_version: nil)
|
||||
puts "#{count} posts were flagged for a rebake"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user