2020-03-01 18:43:35 -05:00
|
|
|
#!/usr/bin/env ruby
|
2024-02-25 12:15:55 -05:00
|
|
|
# frozen_string_literal: true
|
2020-03-01 18:43:35 -05:00
|
|
|
|
|
|
|
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment'))
|
|
|
|
|
|
|
|
Post.find_each do |post|
|
|
|
|
puts "#{post.id}"
|
2022-08-06 12:58:24 -04:00
|
|
|
prev = PostVersion.new
|
2020-03-01 18:43:35 -05:00
|
|
|
post.versions.each do |v|
|
|
|
|
v.fill_changes(prev)
|
|
|
|
v.update_columns(
|
|
|
|
added_tags: v.added_tags,
|
|
|
|
removed_tags: v.removed_tags,
|
|
|
|
added_locked_tags: v.added_locked_tags,
|
|
|
|
removed_locked_tags: v.removed_locked_tags,
|
|
|
|
rating_changed: v.rating_changed,
|
|
|
|
parent_changed: v.parent_changed,
|
|
|
|
source_changed: v.source_changed,
|
|
|
|
description_changed: v.description_changed
|
|
|
|
)
|
|
|
|
prev = v
|
|
|
|
end
|
|
|
|
end
|