Class: AddAdminToUsers

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/chapter10/solutions/snippets/migration_add_admin_to_users.rb

Class Method Summary collapse

Class Method Details

.downObject



6
7
8
# File 'lib/generators/chapter10/solutions/snippets/migration_add_admin_to_users.rb', line 6

def self.down
  remove_column :users, :admin
end

.upObject



2
3
4
# File 'lib/generators/chapter10/solutions/snippets/migration_add_admin_to_users.rb', line 2

def self.up
  add_column :users, :admin, :boolean, :default => false, :null => false
end