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.11.7 db/migrations/20110207200431_add_indexes.rb
appstats-0.11.6 db/migrations/20110207200431_add_indexes.rb
appstats-0.11.5 db/migrations/20110207200431_add_indexes.rb
appstats-0.11.4 db/migrations/20110207200431_add_indexes.rb
appstats-0.11.3 db/migrations/20110207200431_add_indexes.rb
appstats-0.11.2 db/migrations/20110207200431_add_indexes.rb
appstats-0.10.0 db/migrations/20110207200431_add_indexes.rb
appstats-0.9.2 db/migrations/20110207200431_add_indexes.rb
appstats-0.9.1 db/migrations/20110207200431_add_indexes.rb
appstats-0.9.0 db/migrations/20110207200431_add_indexes.rb
appstats-0.8.3 db/migrations/20110207200431_add_indexes.rb
appstats-0.8.2 db/migrations/20110207200431_add_indexes.rb
appstats-0.8.1 db/migrations/20110207200431_add_indexes.rb
appstats-0.8.0 db/migrations/20110207200431_add_indexes.rb
appstats-0.7.0 db/migrations/20110207200431_add_indexes.rb
appstats-0.6.1 db/migrations/20110207200431_add_indexes.rb
appstats-0.6.0 db/migrations/20110207200431_add_indexes.rb
appstats-0.4.0 db/migrations/20110207200431_add_indexes.rb
appstats-0.3.1 db/migrations/20110207200431_add_indexes.rb
appstats-0.1.0 db/migrations/20110207200431_add_indexes.rb