2019-05-03 06:17:27 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-31 12:06:56 +08:00
|
|
|
class MigrateOldMovedPosts < ActiveRecord::Migration[4.2]
|
2015-08-01 07:06:19 +08:00
|
|
|
def up
|
|
|
|
execute "UPDATE posts SET post_type = 3, action_code = 'split_topic' WHERE post_type = 2 AND raw ~* '^I moved [a\\d]+ posts? to a new topic:'"
|
|
|
|
execute "UPDATE posts SET post_type = 3, action_code = 'split_topic' WHERE post_type = 2 AND raw ~* '^I moved [a\\d]+ posts? to an existing topic:'"
|
|
|
|
end
|
2024-10-25 15:13:06 +08:00
|
|
|
|
|
|
|
def down
|
|
|
|
raise ActiveRecord::IrreversibleMigration
|
|
|
|
end
|
2015-08-01 07:06:19 +08:00
|
|
|
end
|