Sha256: e836a5d24de4aed535bdfe03543515434fe39dc4902e17e38bb667b7772b5908

Contents?: true

Size: 1.41 KB

Versions: 80

Compression:

Stored size: 1.41 KB

Contents

class AddIndexes < ActiveRecord::Migration
  def self.up
    add_index :appstats_log_collectors, :host
    add_index :appstats_entries, :action
    add_index :appstats_entries, :year, :name => "index_entries_by_year"
    add_index :appstats_entries, [:year,:month], :name => "index_entries_by_month"
    add_index :appstats_entries, [:year,:month,:day], :name => "index_entries_by_day"
    add_index :appstats_entries, [:year,:month,:day,:hour], :name => "index_entries_by_hour"
    add_index :appstats_entries, [:year,:month,:day,:hour,:minute], :name => "index_entries_by_minute"
    add_index :appstats_contexts, [:context_key,:context_value]
    add_index :appstats_contexts, [:context_key,:context_int]
    add_index :appstats_contexts, [:context_key,:context_float]
  end

  def self.down
    remove_index :appstats_log_collectors, :host
    remove_index :appstats_entries, :action
    remove_index :appstats_entries, :name => "index_entries_by_year"
    remove_index :appstats_entries, :name => "index_entries_by_month"
    remove_index :appstats_entries, :name => "index_entries_by_day"
    remove_index :appstats_entries, :name => "index_entries_by_hour"
    remove_index :appstats_entries, :name => "index_entries_by_minute"
    remove_index :appstats_contexts, [:context_key,:context_value]
    remove_index :appstats_contexts, [:context_key,:context_int]
    remove_index :appstats_contexts, [:context_key,:context_float]
  end
end

Version data entries

80 entries across 80 versions & 1 rubygems

Version Path
appstats-0.17.0 db/migrations/20110207200431_add_indexes.rb
appstats-0.16.7 db/migrations/20110207200431_add_indexes.rb
appstats-0.16.6 db/migrations/20110207200431_add_indexes.rb
appstats-0.16.5 db/migrations/20110207200431_add_indexes.rb
appstats-0.16.4 db/migrations/20110207200431_add_indexes.rb
appstats-0.16.3 db/migrations/20110207200431_add_indexes.rb
appstats-0.16.2 db/migrations/20110207200431_add_indexes.rb
appstats-0.16.1 db/migrations/20110207200431_add_indexes.rb
appstats-0.15.1 db/migrations/20110207200431_add_indexes.rb
appstats-0.15.0 db/migrations/20110207200431_add_indexes.rb
appstats-0.14.0 db/migrations/20110207200431_add_indexes.rb
appstats-0.13.4 db/migrations/20110207200431_add_indexes.rb
appstats-0.13.3 db/migrations/20110207200431_add_indexes.rb
appstats-0.13.2 db/migrations/20110207200431_add_indexes.rb
appstats-0.13.1 db/migrations/20110207200431_add_indexes.rb
appstats-0.13.0 db/migrations/20110207200431_add_indexes.rb
appstats-0.12.5 db/migrations/20110207200431_add_indexes.rb
appstats-0.12.4 db/migrations/20110207200431_add_indexes.rb
appstats-0.12.2 db/migrations/20110207200431_add_indexes.rb
appstats-0.12.1 db/migrations/20110207200431_add_indexes.rb