Class: Taskr::Models::AddLoggingTables

Inherits:
V
  • Object
show all
Defined in:
lib/taskr/models.rb

Class Method Summary collapse

Class Method Details

.downObject



421
422
423
# File 'lib/taskr/models.rb', line 421

def self.down
  drop_table :taskr_log_entries
end

.upObject



405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
# File 'lib/taskr/models.rb', line 405

def self.up
  $LOG.info("Creating logging tables")
  
  create_table :taskr_log_entries, :force => true do |t|
    t.column :task_id, :integer
    t.column :task_action_id, :integer
    
    t.column :timestamp, :timestamp, :null => false
    t.column :level, :string, :null => false
    t.column :data, :text
  end
  
  add_index :taskr_log_entries, :task_id
  add_index :taskr_log_entries, :task_action_id
end