Fix ahoy tracking and visits

This commit is contained in:
Stella Rouzi 2018-03-18 10:57:39 +02:00 committed by James Mason
parent b54e3f7ab9
commit 3bb73f27cf
6 changed files with 38 additions and 21 deletions

View file

@ -0,0 +1,11 @@
# frozen_string_literal: true
class CreateAhoyVisitsAndEvents < ActiveRecord::Migration[5.0]
def change
add_column :visits, :visit_token, :string
add_column :visits, :visitor_token, :string
add_index :visits, [:visit_token], unique: true
add_index :ahoy_events, [:name, :time]
end
end

View file

@ -18,6 +18,7 @@ ActiveRecord::Schema.define(version: 20180316220446) do
t.string "name"
t.text "properties"
t.datetime "time"
t.index ["name", "time"], name: "index_ahoy_events_on_name_and_time"
t.index ["time"], name: "index_ahoy_events_on_time"
t.index ["user_id"], name: "index_ahoy_events_on_user_id"
t.index ["visit_id"], name: "index_ahoy_events_on_visit_id"
@ -651,7 +652,10 @@ ActiveRecord::Schema.define(version: 20180316220446) do
t.string "utm_content"
t.string "utm_campaign"
t.datetime "started_at"
t.string "visit_token"
t.string "visitor_token"
t.index ["user_id"], name: "index_visits_on_user_id"
t.index ["visit_token"], name: "index_visits_on_visit_token", unique: true
end
create_table "votes", force: :cascade do |t|