discourse/db/migrate/20120705181724_add_user_to_versions.rb

8 lines
232 B
Ruby

class AddUserToVersions < ActiveRecord::Migration[4.2]
def change
execute "UPDATE versions SET user_type = 'User', user_id = posts.user_id
FROM posts
WHERE posts.id = versions.versioned_id"
end
end