Skip to content

Adds last_enforced_at column to NamespaceLimits

Vijay Hawoldar requested to merge vij-track-last-enforced-at into master

What does this MR do and why?

Adds last_enforced_at column to NamespaceLimits

In order to track when a root namespace last had storage enforcement apply to the namespace, this adds the column and associated logic that will update the timestamp once per day.

Refs https://gitlab.com/gitlab-org/gitlab/-/issues/382200

bin/rails db:migrate

main: == [advisory_lock_connection] object_id: 223520, pg_backend_pid: 56819
main: == 20230629071427 AddLastEnforcedAtToNamespaceLimits: migrating ===============
main: -- add_column(:namespace_limits, :last_enforced_at, :datetime_with_timezone)
main:    -> 0.0018s
main: == 20230629071427 AddLastEnforcedAtToNamespaceLimits: migrated (0.0061s) ======

bin/rails db:rollback:main
main: == [advisory_lock_connection] object_id: 223280, pg_backend_pid: 56346
main: == 20230629071427 AddLastEnforcedAtToNamespaceLimits: reverting ===============
main: -- remove_column(:namespace_limits, :last_enforced_at, :datetime_with_timezone)
main:    -> 0.0019s
main: == 20230629071427 AddLastEnforcedAtToNamespaceLimits: reverted (0.0077s) ======

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

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

Edited by Vijay Hawoldar

Merge request reports