[BE] Add `last_activity_on` column to Members
Background
In [Gitlab.com] Automatic removal of dormant members (&7533) we intend to add a feature to identify and remove dormant users from Namespaces for GitLab.com
This is similar to the existing SM feature ( &5519), but rather than deactivating users, we will remove members.
To achieve this, we will be adding a way to track member’s last activity timestamp within a namespace, so that we can identify dormant members and remove them if they've been dormant for greater than a predefined time period (e.g. 90 days).
Purpose
The purpose of this issue is to:
Add a column to the Members
table that we'll use for tracking their last activity time
We can follow the same path that was taken for Users#last_activity_on
for this, as it'll be used in much the same way:
- Create a migration to add a timestamp column to
Members
- no default value
- Pre-populate existing records with the current time (at time of migration). This will mean that when it comes to enabling the feature, we won't remove members immediately (i.e. because they have a
nil
value). This approach is not set in stone, we can take a different one if necessary. See #460840 (comment 1899076064) for more background/info around this decision.
The tracking of the activity will be handled in [BE] Track member last activity time (#461338)