Sha256: 1309708b328285c8f5dcb01b242c713b29faf1c235b2601ed230822eb3dee8e7

Contents?: true

Size: 1.78 KB

Versions: 29

Compression:

Stored size: 1.78 KB

Contents

class CreateImpressionsTable < ActiveRecord::Migration
  def self.up
    add_column :impressions, :session_hash, :string
    remove_index :impressions, :name => :poly_index
    remove_index :impressions, :name => :controlleraction_index
    add_index :impressions, [:impressionable_type, :impressionable_id, :request_hash], :name => "poly_request_index", :unique => false
    add_index :impressions, [:impressionable_type, :impressionable_id, :ip_address], :name => "poly_ip_index", :unique => false
    add_index :impressions, [:impressionable_type, :impressionable_id, :session_hash], :name => "poly_session_index", :unique => false
    add_index :impressions, [:controller_name,:action_name,:request_hash], :name => "controlleraction_request_index", :unique => false
    add_index :impressions, [:controller_name,:action_name,:ip_address], :name => "controlleraction_ip_index", :unique => false
    add_index :impressions, [:controller_name,:action_name,:session_hash], :name => "controlleraction_session_index", :unique => false

  end

  def self.down
    remove_column :impressions, :session_hash
    remove_index :impressions, :name => :poly_request_index
    remove_index :impressions, :name => :poly_ip_index
    remove_index :impressions, :name => :poly_session_index
    remove_index :impressions, :name => :controlleraction_request_index
    remove_index :impressions, :name => :controlleraction_ip_index
    remove_index :impressions, :name => :controlleraction_session_index
    remove_index :impressions, :user_id
    add_index :impressions, [:impressionable_type, :impressionable_id, :request_hash, :ip_address], :name => "poly_index", :unique => false
    add_index :impressions, [:controller_name,:action_name,:request_hash,:ip_address], :name => "controlleraction_index", :unique => false
  end
end

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
impressionist-2.0.0 upgrade_migrations/version_0_3_0.rb
impressionist-1.6.1 upgrade_migrations/version_0_3_0.rb
impressionist-1.6.0 upgrade_migrations/version_0_3_0.rb
impressionist-1.5.2 upgrade_migrations/version_0_3_0.rb
impressionist2-1.5.5 upgrade_migrations/version_0_3_0.rb
impressionist2-1.5.4 upgrade_migrations/version_0_3_0.rb
impressionist2-1.5.3 upgrade_migrations/version_0_3_0.rb
impressionist2-1.5.1 upgrade_migrations/version_0_3_0.rb
impressionist-1.5.1 upgrade_migrations/version_0_3_0.rb
impressionist-1.4.13 upgrade_migrations/version_0_3_0.rb
impressionist-1.4.12 upgrade_migrations/version_0_3_0.rb
impressionist-1.4.11 upgrade_migrations/version_0_3_0.rb
impressionist-1.4.10 upgrade_migrations/version_0_3_0.rb
impressionist-1.4.9 upgrade_migrations/version_0_3_0.rb
impressionist-1.4.8 upgrade_migrations/version_0_3_0.rb
impressionist-1.4.7 upgrade_migrations/version_0_3_0.rb
impressionist-1.4.6 upgrade_migrations/version_0_3_0.rb
impressionist-1.4.5 upgrade_migrations/version_0_3_0.rb
impressionist-1.4.4 upgrade_migrations/version_0_3_0.rb
impressionist-1.4.3 upgrade_migrations/version_0_3_0.rb