You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

14 lines
327 B

class UserSecret < ActiveRecord::Migration
def self.up
add_column :users, :secret, :string, :null => true
User.find(:all).each do |user|
user.update_attribute(:secret, User.random_string(32))
end
change_column :users, :secret, :string, :null => false
end
def self.down
remove_column :users, :secret
end
end