diff options
Diffstat (limited to 'db/post_migrate/20231011200058_drop_index_namespaces_on_updated_at.rb')
-rw-r--r-- | db/post_migrate/20231011200058_drop_index_namespaces_on_updated_at.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/db/post_migrate/20231011200058_drop_index_namespaces_on_updated_at.rb b/db/post_migrate/20231011200058_drop_index_namespaces_on_updated_at.rb new file mode 100644 index 00000000000..68787442931 --- /dev/null +++ b/db/post_migrate/20231011200058_drop_index_namespaces_on_updated_at.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class DropIndexNamespacesOnUpdatedAt < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = :namespaces + INDEX_NAME = :index_namespaces_on_updated_at + + def up + remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME + end + + def down + # no-op + # Since adding the same index will be time consuming, + # we have to create it asynchronously using 'prepare_async_index' helper. + end +end |