Class: Bookie::Database::Migration::CreateUsers

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/bookie/database.rb

Instance Method Summary collapse

Instance Method Details

#downObject



37
38
39
# File 'lib/bookie/database.rb', line 37

def down
  drop_table :users
end

#upObject



27
28
29
30
31
32
33
34
35
# File 'lib/bookie/database.rb', line 27

def up
  create_table :users do |t|
    t.string :name, :null => false
    t.references :group, :null => false
  end
  change_table :users do |t|
    t.index [:name, :group_id], :unique => true
  end
end