Class: Bookie::Database::Migration::CreateJobs

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

Instance Method Summary collapse

Instance Method Details

#downObject



120
121
122
# File 'lib/bookie/database.rb', line 120

def down
  drop_table :jobs
end

#upObject



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/bookie/database.rb', line 97

def up
  create_table :jobs do |t|
    t.references :user, :null => false
    t.references :system, :null => false
    t.string :command_name, :limit => 24, :null => false
    t.datetime :start_time, :null => false
    t.datetime :end_time, :null => false
    t.integer :wall_time, :null => false
    t.integer :cpu_time, :null => false
    t.integer :memory, :null => false
    t.integer :exit_code, :null => false
  end
  #TODO: more indices?
  change_table :jobs do |t|
    t.index :user_id
    t.index :system_id
    t.index :command_name
    t.index :start_time
    t.index :end_time
    t.index :exit_code
  end
end