Sha256: d433c35c2e8f064baa4f3066661bcb953f3659124c737954f14b1db93f54f374
Contents?: true
Size: 766 Bytes
Versions: 65
Compression:
Stored size: 766 Bytes
Contents
class AddOpenidFieldToUsers < ActiveRecord::Migration def self.up add_column :users, :openid_identifier, :string add_index :users, :openid_identifier change_column :users, :login, :string, :default => nil, :null => true change_column :users, :crypted_password, :string, :default => nil, :null => true change_column :users, :salt, :string, :default => nil, :null => true end def self.down remove_column :users, :openid_identifier [:login, :crypted_password, :salt].each do |field| User.all(:conditions => "#{field} is NULL").each { |user| user.update_attribute(field, "") if user.send(field).nil? } change_column :users, field, :string, :default => "", :null => false end end end
Version data entries
65 entries across 53 versions & 10 rubygems