Sha256: 2cb52863fc8b189b65d3ddef99079366defe40c430802ff23f9e74a5c7f57a9a
Contents?: true
Size: 993 Bytes
Versions: 59
Compression:
Stored size: 993 Bytes
Contents
class CreateSystemVisitsAndEvents < ActiveRecord::Migration[5.1] def change create_table :system_visits do |t| t.string :visit_token t.string :visitor_token # the rest are recommended but optional # simply remove any you don't want # user t.references :user, index: true # standard t.string :ip t.text :user_agent t.text :referrer t.string :referring_domain t.string :search_keyword t.text :landing_page # technology t.string :browser t.string :os t.string :device_type t.timestamp :started_at end add_index :system_visits, [:visit_token], unique: true create_table :system_events do |t| t.references :visit t.references :user, index: true t.timestamp :time t.string :name t.jsonb :properties end add_index :system_events, [:name, :time] add_index :system_events, "properties jsonb_path_ops", using: "gin" end end
Version data entries
59 entries across 59 versions & 1 rubygems