Sha256: b6f60668151a3e0b739fa00fef0dea2aa031d0804f7aa844702d9a97ee0e4e1e

Contents?: true

Size: 277 Bytes

Versions: 6

Compression:

Stored size: 277 Bytes

Contents

class AddStateToUser < ActiveRecord::Migration
  def self.up
    add_column :users, :state, :string, :default => 'active'
    
    unless $schema_generator
      User.update_all("state = 'active'")
    end
    
  end

  def self.down
    remove_column :users, :state
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
typo-5.5 db/migrate/080_add_state_to_user.rb
typo-5.4.4 db/migrate/080_add_state_to_user.rb
typo-5.4.3 db/migrate/080_add_state_to_user.rb
typo-5.4.2 db/migrate/080_add_state_to_user.rb
typo-5.4.1 db/migrate/080_add_state_to_user.rb
typo-5.4 db/migrate/080_add_state_to_user.rb