Sha256: 3b50289543644d6627a4f3ec0527cc204f05797cea54bbc82bfafd3432f056aa

Contents?: true

Size: 929 Bytes

Versions: 1

Compression:

Stored size: 929 Bytes

Contents

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

      # 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

      t.timestamp :created_at
    end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ahoy_matey-0.1.0 lib/generators/ahoy/templates/install.rb