You can check out https://www.driftingruby.com/episodes/virtual-columns-in-mysql and https://www.driftingruby.com/episodes/virtual-columns-with-json-data-types on Virtual Columns.
What environment are you working in?
It is a Rails application, so you would need to have Ruby installed. Check out https://www.driftingruby.com/episodes/getting-started-ruby-on-rails-development-environment on getting a non-system ruby installed on your environment.
Then in the app root, you should be able to just do
gem install bundler #installs bundle cli
bundle # installs gem dependencies
rake db:migrate # creates the SQLite3 Schema
rails s # starts the development server
You might be able to do something like this for a daily count
current_user.impressions.group_by_day(:created_at).count
The methods are within the GroupDate gem https://github.com/ankane/groupdate
The gem's documentation does say that it is compatible with postgres, but I am not sure if there is any additional setup on postgres like there is with MySQL.