Sha256: 055e6d1440dc114cbf0d82a280c455799c025887688c93b266fc9ee4200db617

Contents?: true

Size: 1.11 KB

Versions: 12

Compression:

Stored size: 1.11 KB

Contents

class <%= migration_class_name %> < ActiveRecord::Migration
  def change
    create_table :visits do |t|
      # cookies
      t.string :visit_token
      t.string :visitor_token

      # the rest are recommended but optional
      # simply remove the columns you don't want

      # standard
      t.string :ip
      t.text :user_agent
      t.text :referrer
      t.text :landing_page

      # user
      t.integer :user_id
      t.string :user_type

      # traffic source
      t.string :referring_domain
      t.string :search_keyword

      # technology
      t.string :browser
      t.string :os
      t.string :device_type

      # location
      t.string :country
      t.string :region
      t.string :city

      # utm parameters
      t.string :utm_source
      t.string :utm_medium
      t.string :utm_term
      t.string :utm_content
      t.string :utm_campaign

      # native apps
      # t.string :platform
      # t.string :app_version
      # t.string :os_version

      t.timestamp :created_at
    end

    add_index :visits, [:visit_token], unique: true
    add_index :visits, [:user_id, :user_type]
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ahoy_matey-0.3.2 lib/generators/ahoy/templates/install.rb
ahoy_matey-0.3.1 lib/generators/ahoy/templates/install.rb
ahoy_matey-0.3.0 lib/generators/ahoy/templates/install.rb
ahoy_matey-0.2.2 lib/generators/ahoy/templates/install.rb
ahoy_matey-0.2.1 lib/generators/ahoy/templates/install.rb
ahoy_matey-0.2.0 lib/generators/ahoy/templates/install.rb
ahoy_matey-0.1.8 lib/generators/ahoy/templates/install.rb
ahoy_matey-0.1.7 lib/generators/ahoy/templates/install.rb
ahoy_matey-0.1.6 lib/generators/ahoy/templates/install.rb
ahoy_matey-0.1.5 lib/generators/ahoy/templates/install.rb
ahoy_matey-0.1.4 lib/generators/ahoy/templates/install.rb
ahoy_matey-0.1.3 lib/generators/ahoy/templates/install.rb