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.25.1 db/migrate/20110207200431_add_indexes.rb
appstats-0.25.0 db/migrate/20110207200431_add_indexes.rb
appstats-0.24.0 db/migrate/20110207200431_add_indexes.rb
appstats-0.23.5 db/migrations/20110207200431_add_indexes.rb
appstats-0.23.4 db/migrations/20110207200431_add_indexes.rb
appstats-0.23.3 db/migrations/20110207200431_add_indexes.rb
appstats-0.23.2 db/migrations/20110207200431_add_indexes.rb
appstats-0.23.1 db/migrations/20110207200431_add_indexes.rb
appstats-0.23.0 db/migrations/20110207200431_add_indexes.rb
appstats-0.22.6 db/migrations/20110207200431_add_indexes.rb
appstats-0.22.5 db/migrations/20110207200431_add_indexes.rb
appstats-0.22.4 db/migrations/20110207200431_add_indexes.rb
appstats-0.22.3 db/migrations/20110207200431_add_indexes.rb
appstats-0.22.2 db/migrations/20110207200431_add_indexes.rb
appstats-0.22.1 db/migrations/20110207200431_add_indexes.rb
appstats-0.22.0 db/migrations/20110207200431_add_indexes.rb
appstats-0.21.3 db/migrations/20110207200431_add_indexes.rb
appstats-0.21.2 db/migrations/20110207200431_add_indexes.rb
appstats-0.21.1 db/migrations/20110207200431_add_indexes.rb
appstats-0.20.12 db/migrations/20110207200431_add_indexes.rb