Implements targets and campaigns for conference
This commit is contained in:
parent
678fe38a25
commit
857ac43e74
40 changed files with 1086 additions and 44 deletions
12
db/migrate/20140616132153_create_targets.rb
Normal file
12
db/migrate/20140616132153_create_targets.rb
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
class CreateTargets < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :targets do |t|
|
||||
t.integer :conference_id
|
||||
t.integer :campaign_id
|
||||
t.date :due_date
|
||||
t.integer :target_count
|
||||
t.string :unit
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
14
db/migrate/20140616132456_create_campaigns.rb
Normal file
14
db/migrate/20140616132456_create_campaigns.rb
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
class CreateCampaigns < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :campaigns do |t|
|
||||
t.integer :conference_id
|
||||
t.string :name
|
||||
t.string :utm_source
|
||||
t.string :utm_medium
|
||||
t.string :utm_term
|
||||
t.string :utm_content
|
||||
t.string :utm_campaign
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
51
db/migrate/20140623100942_create_visits.rb
Normal file
51
db/migrate/20140623100942_create_visits.rb
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
class CreateVisits < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :visits, id: false do |t|
|
||||
t.uuid :id, primary_key: true
|
||||
t.uuid :visitor_id
|
||||
|
||||
# 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
|
||||
# add t.string :user_type if polymorphic
|
||||
|
||||
# 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 :started_at
|
||||
end
|
||||
|
||||
add_index :visits, [:user_id]
|
||||
end
|
||||
end
|
||||
20
db/migrate/20140623101032_create_ahoy_events.rb
Normal file
20
db/migrate/20140623101032_create_ahoy_events.rb
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
class CreateAhoyEvents < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :ahoy_events, id: false do |t|
|
||||
t.uuid :id, primary_key: true
|
||||
t.uuid :visit_id
|
||||
|
||||
# user
|
||||
t.integer :user_id
|
||||
# add t.string :user_type if polymorphic
|
||||
|
||||
t.string :name
|
||||
t.text :properties
|
||||
t.timestamp :time
|
||||
end
|
||||
|
||||
add_index :ahoy_events, [:visit_id]
|
||||
add_index :ahoy_events, [:user_id]
|
||||
add_index :ahoy_events, [:time]
|
||||
end
|
||||
end
|
||||
63
db/schema.rb
63
db/schema.rb
|
|
@ -11,7 +11,20 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20140620134535) do
|
||||
ActiveRecord::Schema.define(version: 20140623101032) do
|
||||
|
||||
create_table "ahoy_events", force: true do |t|
|
||||
t.uuid "visit_id"
|
||||
t.integer "user_id"
|
||||
t.string "name"
|
||||
t.text "properties"
|
||||
t.datetime "time"
|
||||
end
|
||||
|
||||
#add_index "ahoy_events", ["id"], name: "sqlite_autoindex_ahoy_events_1", unique: true
|
||||
add_index "ahoy_events", ["time"], name: "index_ahoy_events_on_time"
|
||||
add_index "ahoy_events", ["user_id"], name: "index_ahoy_events_on_user_id"
|
||||
add_index "ahoy_events", ["visit_id"], name: "index_ahoy_events_on_visit_id"
|
||||
|
||||
create_table "answers", force: true do |t|
|
||||
t.string "title"
|
||||
|
|
@ -32,6 +45,18 @@ ActiveRecord::Schema.define(version: 20140620134535) do
|
|||
t.boolean "include_cfp_in_splash", default: false
|
||||
end
|
||||
|
||||
create_table "campaigns", force: true do |t|
|
||||
t.integer "conference_id"
|
||||
t.string "name"
|
||||
t.string "utm_source"
|
||||
t.string "utm_medium"
|
||||
t.string "utm_term"
|
||||
t.string "utm_content"
|
||||
t.string "utm_campaign"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
create_table "comments", force: true do |t|
|
||||
t.string "title", limit: 50, default: ""
|
||||
t.text "body"
|
||||
|
|
@ -381,6 +406,16 @@ ActiveRecord::Schema.define(version: 20140620134535) do
|
|||
t.datetime "created_at"
|
||||
end
|
||||
|
||||
create_table "targets", force: true do |t|
|
||||
t.integer "conference_id"
|
||||
t.integer "campaign_id"
|
||||
t.date "due_date"
|
||||
t.integer "target_count"
|
||||
t.string "unit"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
create_table "tracks", force: true do |t|
|
||||
t.string "guid", null: false
|
||||
t.integer "conference_id"
|
||||
|
|
@ -457,6 +492,32 @@ ActiveRecord::Schema.define(version: 20140620134535) do
|
|||
|
||||
add_index "versions", ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id"
|
||||
|
||||
create_table "visits", force: true do |t|
|
||||
t.uuid "visitor_id"
|
||||
t.string "ip"
|
||||
t.text "user_agent"
|
||||
t.text "referrer"
|
||||
t.text "landing_page"
|
||||
t.integer "user_id"
|
||||
t.string "referring_domain"
|
||||
t.string "search_keyword"
|
||||
t.string "browser"
|
||||
t.string "os"
|
||||
t.string "device_type"
|
||||
t.string "country"
|
||||
t.string "region"
|
||||
t.string "city"
|
||||
t.string "utm_source"
|
||||
t.string "utm_medium"
|
||||
t.string "utm_term"
|
||||
t.string "utm_content"
|
||||
t.string "utm_campaign"
|
||||
t.datetime "started_at"
|
||||
end
|
||||
|
||||
#add_index "visits", ["id"], name: "sqlite_autoindex_visits_1", unique: true
|
||||
add_index "visits", ["user_id"], name: "index_visits_on_user_id"
|
||||
|
||||
create_table "votes", force: true do |t|
|
||||
t.integer "person_id"
|
||||
t.integer "event_id"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue