From b9874f9c9120b17f7040c4b5187f62f8ee5b61d2 Mon Sep 17 00:00:00 2001 From: Joseph Snyder Date: Fri, 5 Aug 2022 10:45:41 -0400 Subject: [PATCH] Add dormant user period setting to application settings MR 1 of 2. Perform the first step to allow customization of the time period that needs to elapse before a user is considered dormant and can be automatically removed. Add the column to the application settings table with the default of 90 to match the current value. Changelog: added --- ...220802154757_add_deactivate_dormant_user_time_setting.rb | 6 ++++++ db/schema_migrations/20220802154757 | 1 + db/structure.sql | 1 + 3 files changed, 8 insertions(+) create mode 100644 db/migrate/20220802154757_add_deactivate_dormant_user_time_setting.rb create mode 100644 db/schema_migrations/20220802154757 diff --git a/db/migrate/20220802154757_add_deactivate_dormant_user_time_setting.rb b/db/migrate/20220802154757_add_deactivate_dormant_user_time_setting.rb new file mode 100644 index 00000000000000..ca887cc22558b6 --- /dev/null +++ b/db/migrate/20220802154757_add_deactivate_dormant_user_time_setting.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true +class AddDeactivateDormantUserTimeSetting < Gitlab::Database::Migration[2.0] + def change + add_column :application_settings, :deactivate_dormant_users_period, :integer, default: 90, null: false + end +end diff --git a/db/schema_migrations/20220802154757 b/db/schema_migrations/20220802154757 new file mode 100644 index 00000000000000..a92f69e31da58a --- /dev/null +++ b/db/schema_migrations/20220802154757 @@ -0,0 +1 @@ +17d0f47b4663fdbcba617a456f713ebfe3782318abc7e46dc4a8e69bc76cf16f \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 5b6e41a5315086..8892c162094926 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -11457,6 +11457,7 @@ CREATE TABLE application_settings ( git_rate_limit_users_allowlist text[] DEFAULT '{}'::text[] NOT NULL, error_tracking_access_token_encrypted text, package_registry_cleanup_policies_worker_capacity integer DEFAULT 2 NOT NULL, + deactivate_dormant_users_period integer DEFAULT 90 NOT NULL, CONSTRAINT app_settings_container_reg_cleanup_tags_max_list_size_positive CHECK ((container_registry_cleanup_tags_service_max_list_size >= 0)), CONSTRAINT app_settings_container_registry_pre_import_tags_rate_positive CHECK ((container_registry_pre_import_tags_rate >= (0)::numeric)), CONSTRAINT app_settings_dep_proxy_ttl_policies_worker_capacity_positive CHECK ((dependency_proxy_ttl_group_policy_worker_capacity >= 0)), -- GitLab