|
|
class AddUtmToPlayers < ActiveRecord::Migration[8.1]
|
|
|
def change
|
|
|
# Where the player came from. The campaign is run on printed QR codes, so
|
|
|
# `utm_content` is the interesting one -- it names the physical thing that
|
|
|
# was scanned (table_talker, canteen_poster, ...). The other three are kept
|
|
|
# so a non-QR link (mail, intranet) can still be told apart later.
|
|
|
add_column :players, :utm_source, :string
|
|
|
add_column :players, :utm_medium, :string
|
|
|
add_column :players, :utm_campaign, :string
|
|
|
add_column :players, :utm_content, :string
|
|
|
|
|
|
add_index :players, :utm_content
|
|
|
add_index :players, :utm_source
|
|
|
end
|
|
|
end
|