Sha256: a9551f33c27394611109527e7a699ccfa2bf6c1d24855f161125b01295d4226e
Contents?: true
Size: 864 Bytes
Versions: 4
Compression:
Stored size: 864 Bytes
Contents
class AddOpenidFieldToUsers < ActiveRecord::Migration def 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 down remove_column :users, :openid_identifier # Due to namespacing change, temporarily set the table back to users Spree::User.table_name = 'users' [:login, :crypted_password, :salt].each do |field| Spree::User.where(field => nil).each { |user| user.update_column(field, '') if user.send(field).nil? } change_column :users, field, :string, :default => '', :null => false end Spree::User.table_name = 'spree_users' end end
Version data entries
4 entries across 4 versions & 1 rubygems