Skip to content

Add with_highest_role_minimal_access to statistics

Ammar Alakkad requested to merge 342516-add-minimal-access-user-statistics into master

What does this MR do and why?

  • Adds with_highest_role_minimal_access column to users_statistics table
  • Shows statistics for users with minimal access in admin -> users statistics (only when the subscription is premium+)

Screenshots or screen recordings

before after
Screen_Shot_2021-11-03_at_3.28.06_PM Screen_Shot_2021-11-03_at_3.27.21_PM

How to set up and validate locally

  1. Checkout the branch
  2. Login as root
  3. Navigate to admin -> dashboard -> users statistics (/admin/dashboard/stats)

Database up/down logs

> bundle exec rails db:migrate:up VERSION=20211103062728
== 20211103062728 AddWithHighestRoleMinimalAccessToUsersStatistics: migrating =
-- add_column(:users_statistics, :with_highest_role_minimal_access, :integer, {:null=>false, :default=>0})
   -> 0.0047s
== 20211103062728 AddWithHighestRoleMinimalAccessToUsersStatistics: migrated (0.0048s)

> bundle exec rails db:migrate:down VERSION=20211103062728
== 20211103062728 AddWithHighestRoleMinimalAccessToUsersStatistics: reverting =
-- remove_column(:users_statistics, :with_highest_role_minimal_access, :integer, {:null=>false, :default=>0})
   -> 0.0039s
== 20211103062728 AddWithHighestRoleMinimalAccessToUsersStatistics: reverted (0.0074s)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #342516 (closed)

Edited by Ammar Alakkad

Merge request reports

Loading