Skip to content

Instantly share code, notes, and snippets.

@mPanasiewicz
Last active September 21, 2015 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mPanasiewicz/79275cf20d18f28a314b to your computer and use it in GitHub Desktop.
Save mPanasiewicz/79275cf20d18f28a314b to your computer and use it in GitHub Desktop.
class AddRequestFieldToCasheNames < ActiveRecord::Migration
class CacheName < ActiveRecord::Base
end
def change
add_column :cache_names, :request, :text
CacheName.find_each do |cache_name|
cache_name.request = '{"method":"get_config","type":"kom","channel":"direct","sign":"587d6320f50666918c40c4bf125164b8","transform_ver":"' + cache_name.transform_ver + '","pkb_content_ver":"A1"}'
cache_name.save
end
change_column_null :cache_names, :request, false
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment