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.60.2 db/migrate/20091015153048_add_openid_field_to_users.rb
spree_core-0.70.0.rc2 db/migrate/20091015153048_add_openid_field_to_users.rb
spree_core-0.70.RC1 db/migrate/20091015153048_add_openid_field_to_users.rb
spree_core-0.60.1 db/migrate/20091015153048_add_openid_field_to_users.rb
spree_core-0.60.0 db/migrate/20091015153048_add_openid_field_to_users.rb
spree_core-0.60.0.RC1 db/migrate/20091015153048_add_openid_field_to_users.rb
spree_essential_press-0.1.0.pre3 test/dummy/db/migrate/20091015153048_add_openid_field_to_users.rb
spree_essential_press-0.1.0.pre2 test/dummy/db/migrate/20091015153048_add_openid_field_to_users.rb
spree_core-0.50.2 db/migrate/20091015153048_add_openid_field_to_users.rb
spree_core-0.50.1 db/migrate/20091015153048_add_openid_field_to_users.rb
spree_core-0.50.0 db/migrate/20091015153048_add_openid_field_to_users.rb
spree_core-0.40.3 db/migrate/20091015153048_add_openid_field_to_users.rb
spree_core-0.40.2 db/migrate/20091015153048_add_openid_field_to_users.rb
spree_core-0.40.1 db/migrate/20091015153048_add_openid_field_to_users.rb
spree_core-0.40.0 db/migrate/20091015153048_add_openid_field_to_users.rb
spree_core-0.30.1 db/migrate/20091015153048_add_openid_field_to_users.rb
spree_core-0.30.0 db/migrate/20091015153048_add_openid_field_to_users.rb
spree-0.11.2 db/migrate/20091015153048_add_openid_field_to_users.rb
spree-0.11.1 db/migrate/20091015153048_add_openid_field_to_users.rb
spree_core-0.30.0.beta1 lib/generators/templates/db/migrate/20091015153048_add_openid_field_to_users.rb