Class: Bookie::Database::Migration::CreateUsers
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- Bookie::Database::Migration::CreateUsers
- Defined in:
- lib/bookie/database.rb
Instance Method Summary collapse
Instance Method Details
#down ⇒ Object
37 38 39 |
# File 'lib/bookie/database.rb', line 37 def down drop_table :users end |
#up ⇒ Object
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 |