Class: CreateMetricValues

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

Class Method Summary collapse

Class Method Details

.downObject



13
14
15
# File 'lib/generators/bodhi/templates/create_metric_values.rb', line 13

def self.down
  drop_table :metric_values
end

.upObject



2
3
4
5
6
7
8
9
10
11
# File 'lib/generators/bodhi/templates/create_metric_values.rb', line 2

def self.up
  create_table :metric_values do |t|
    t.string :metric
    t.datetime :start
    t.datetime :end
    t.float :value
    
  end
  add_index :metric_values, [:metric, :start], :unique => true, :name => 'index_metric_values_on_metric_and_start'
end