Class: Bookie::Database::Migration::CreateSystems

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

Instance Method Summary collapse

Instance Method Details

#downObject



75
76
77
# File 'lib/bookie/database.rb', line 75

def down
  drop_table :systems
end

#upObject



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