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

Version Path
spree_core-0.70.7 db/migrate/20091015153048_add_openid_field_to_users.rb
spree-0.11.4 db/migrate/20091015153048_add_openid_field_to_users.rb
spree_core-0.70.6 db/migrate/20091015153048_add_openid_field_to_users.rb
apispree_core-0.0.0 db/migrate/20091015153048_add_openid_field_to_users.rb
My-Commerce_core-1.1.0 db/migrate/20091015153048_add_openid_field_to_users.rb
My-Commerce_core-1.0.0 db/migrate/20091015153048_add_openid_field_to_users.rb
MyCommerceapi-1.0.0 sandbox/db/migrate/20091015153048_add_openid_field_to_users.rb
MyCommerceapi-1.0.0 core/spec/test_app/db/migrate/20091015153048_add_openid_field_to_users.rb
MyCommerceapi-1.0.0 core/db/migrate/20091015153048_add_openid_field_to_users.rb
MyCommerceapi-1.0.0 api/spec/test_app/db/migrate/20091015153048_add_openid_field_to_users.rb
MyCommerceapi-1.0.0 auth/spec/test_app/db/migrate/20091015153048_add_openid_field_to_users.rb
MyCommerceapi-1.0.0 promo/spec/test_app/db/migrate/20091015153048_add_openid_field_to_users.rb
MyCommerceapi-1.0.0 dash/spec/test_app/db/migrate/20091015153048_add_openid_field_to_users.rb
MyCommerce-0.0.3 api/spec/test_app/db/migrate/20091015153048_add_openid_field_to_users.rb
MyCommerce-0.0.3 core/spec/test_app/db/migrate/20091015153048_add_openid_field_to_users.rb
MyCommerce-0.0.3 auth/spec/test_app/db/migrate/20091015153048_add_openid_field_to_users.rb
MyCommerce-0.0.3 promo/spec/test_app/db/migrate/20091015153048_add_openid_field_to_users.rb
MyCommerce-0.0.3 sandbox/db/migrate/20091015153048_add_openid_field_to_users.rb
MyCommerce-0.0.3 core/db/migrate/20091015153048_add_openid_field_to_users.rb
MyCommerce-0.0.3 dash/spec/test_app/db/migrate/20091015153048_add_openid_field_to_users.rb