Class: CreateMetricsTable

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/system_metrics/migration/templates/migration.rb

Class Method Summary collapse

Class Method Details

.downObject



19
20
21
# File 'lib/generators/system_metrics/migration/templates/migration.rb', line 19

def self.down
  drop_table :system_metrics
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/generators/system_metrics/migration/templates/migration.rb', line 2

def self.up
  create_table :system_metrics, :force => true do |t|
    t.column :name, :string, :null => false
    t.column :started_at, :datetime, :null => false
    t.column :transaction_id, :string
    t.column :payload, :text
    t.column :duration, :float, :null => false
    t.column :exclusive_duration, :float, :null => false
    t.column :request_id, :integer
    t.column :parent_id, :integer
    t.column :action, :string, :null => false
    t.column :category, :string, :null => false
  end

  # TODO: Add indexes
end