diff options
Diffstat (limited to 'db/migrate/20210214205155_add_index_to_namespaces_delayed_project_removal.rb')
-rw-r--r-- | db/migrate/20210214205155_add_index_to_namespaces_delayed_project_removal.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/db/migrate/20210214205155_add_index_to_namespaces_delayed_project_removal.rb b/db/migrate/20210214205155_add_index_to_namespaces_delayed_project_removal.rb new file mode 100644 index 00000000000..8d09a5c9269 --- /dev/null +++ b/db/migrate/20210214205155_add_index_to_namespaces_delayed_project_removal.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddIndexToNamespacesDelayedProjectRemoval < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + INDEX_NAME = 'tmp_idx_on_namespaces_delayed_project_removal' + + disable_ddl_transaction! + + def up + add_concurrent_index :namespaces, :id, name: INDEX_NAME, where: 'delayed_project_removal = TRUE' + end + + def down + remove_concurrent_index_by_name :namespaces, INDEX_NAME + end +end |