diff options
Diffstat (limited to 'db/post_migrate/20230113201308_backfill_namespace_ldap_settings.rb')
-rw-r--r-- | db/post_migrate/20230113201308_backfill_namespace_ldap_settings.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/db/post_migrate/20230113201308_backfill_namespace_ldap_settings.rb b/db/post_migrate/20230113201308_backfill_namespace_ldap_settings.rb new file mode 100644 index 00000000000..19020fecad5 --- /dev/null +++ b/db/post_migrate/20230113201308_backfill_namespace_ldap_settings.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +# See https://docs.gitlab.com/ee/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class BackfillNamespaceLdapSettings < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_main + disable_ddl_transaction! + + DOWNTIME = false + MIGRATION = 'BackfillNamespaceLdapSettings' + TABLE_NAME = 'namespaces' + PRIMARY_KEY = :id + INTERVAL = 2.minutes + + def up + queue_batched_background_migration( + MIGRATION, + TABLE_NAME, + PRIMARY_KEY, + job_interval: INTERVAL + ) + end + + def down + delete_batched_background_migration( + MIGRATION, + TABLE_NAME, + PRIMARY_KEY, + [] + ) + end +end |