mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-04-30 16:31:57 +08:00
We are developing our new composer, and it would be useful if we could know how posts are being created by members. To this end, we are going to start storing the following on post_stats, which are created at the same time as a post is created: * writing_device - Based on `BrowserDetection.device`, which in turn is based on user agent. Will store .e.g iphone, android, mac, windows etc. * writing_user_agent - Stores the full user agent (truncated at 400 chars) of the device/browser the member used to write the post. * composer_version - Either `1` for our old composer, or `2` if the new rich composer is enabled in site settings and the user has toggled it on
9 lines
293 B
Ruby
9 lines
293 B
Ruby
# frozen_string_literal: true
|
|
|
|
class AddComposerColumnsToPostStat < ActiveRecord::Migration[7.2]
|
|
def change
|
|
add_column :post_stats, :composer_version, :integer
|
|
add_column :post_stats, :writing_device, :string
|
|
add_column :post_stats, :writing_device_user_agent, :string
|
|
end
|
|
end
|