Class: Bookie::Database::Migration::CreateSystems
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- Bookie::Database::Migration::CreateSystems
- Defined in:
- lib/bookie/database.rb
Instance Method Summary collapse
Instance Method Details
#down ⇒ Object
75 76 77 |
# File 'lib/bookie/database.rb', line 75 def down drop_table :systems end |
#up ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/bookie/database.rb', line 58 def up create_table :systems do |t| t.string :name, :null => false t.references :system_type, :null => false t.datetime :start_time, :null => false t.datetime :end_time t.integer :cores, :null => false t.integer :memory, :null => false, :limit => 8 end change_table :systems do |t| t.index [:name, :end_time], :unique => true t.index :start_time t.index :end_time t.index :system_type_id end end |