2017-08-31 12:06:56 +08:00
|
|
|
class AddUserToVersions < ActiveRecord::Migration[4.2]
|
2013-02-06 03:16:51 +08:00
|
|
|
def change
|
|
|
|
execute "UPDATE versions SET user_type = 'User', user_id = posts.user_id
|
|
|
|
FROM posts
|
|
|
|
WHERE posts.id = versions.versioned_id"
|
|
|
|
end
|
|
|
|
end
|