Sha256: 50fe0e9b56affda4c007f05d4c6fc292e7dea2f16d1519e8e95f29550243d30e

Contents?: true

Size: 1.5 KB

Versions: 28

Compression:

Stored size: 1.5 KB

Contents

class CreateImpressionsTable < ActiveRecord::Migration
  def self.up
    create_table :impressions, :force => true do |t|
      t.string :impressionable_type
      t.integer :impressionable_id
      t.integer :user_id
      t.string :controller_name
      t.string :action_name
      t.string :view_name
      t.string :request_hash
      t.string :ip_address
      t.string :session_hash
      t.text :message
      t.text :referrer
      t.timestamps
    end
    add_index :impressions, [:impressionable_type, :message, :impressionable_id], :name => "impressionable_type_message_index", :unique => false, :length => {:message => 255 }
    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
    add_index :impressions, :user_id
  end

  def self.down
    drop_table :impressions
  end
end

Version data entries

28 entries across 18 versions & 1 rubygems

Version Path
impressionist-1.5.1 lib/generators/active_record/templates/create_impressions_table.rb
impressionist-1.5.1 tests/test_app/db/migrate/20130719024021_create_impressions_table.rb
impressionist-1.4.13 tests/test_app/db/migrate/20130719024021_create_impressions_table.rb
impressionist-1.4.13 lib/generators/active_record/templates/create_impressions_table.rb
impressionist-1.4.12 tests/test_app/db/migrate/20130719024021_create_impressions_table.rb
impressionist-1.4.12 lib/generators/active_record/templates/create_impressions_table.rb
impressionist-1.4.11 lib/generators/active_record/templates/create_impressions_table.rb
impressionist-1.4.11 tests/test_app/db/migrate/20130719024021_create_impressions_table.rb
impressionist-1.4.10 lib/generators/active_record/templates/create_impressions_table.rb
impressionist-1.4.10 tests/test_app/db/migrate/20130719024021_create_impressions_table.rb
impressionist-1.4.9 tests/test_app/db/migrate/20130719024021_create_impressions_table.rb
impressionist-1.4.9 lib/generators/active_record/templates/create_impressions_table.rb
impressionist-1.4.8 tests/test_app/db/migrate/20130719024021_create_impressions_table.rb
impressionist-1.4.8 lib/generators/active_record/templates/create_impressions_table.rb
impressionist-1.4.7 lib/generators/active_record/templates/create_impressions_table.rb
impressionist-1.4.7 tests/test_app/db/migrate/20130719024021_create_impressions_table.rb
impressionist-1.4.6 lib/generators/active_record/templates/create_impressions_table.rb
impressionist-1.4.6 tests/test_app/db/migrate/20130719024021_create_impressions_table.rb
impressionist-1.4.5 lib/generators/active_record/templates/create_impressions_table.rb
impressionist-1.4.5 tests/test_app/db/migrate/20130719024021_create_impressions_table.rb