Skip to content
Snippets Groups Projects
Verified Commit a0d81b5e authored by Mario Celi's avatar Mario Celi :two: Committed by GitLab
Browse files

Merge branch '541120-prepare-namespace-id-and-id-index' into 'master'

Prepare (namespace_id, id) index on sent_notifications

See merge request !192636



Merged-by: default avatarMario Celi <mcelicalderon@gitlab.com>
Approved-by: default avatarKrasimir Angelov <kangelov@gitlab.com>
Reviewed-by: default avatarKrasimir Angelov <kangelov@gitlab.com>
Reviewed-by: default avatarGitLab Duo <gitlab-duo@gitlab.com>
parents 6a672eba 15c56e6b
No related branches found
No related tags found
No related merge requests found
# frozen_string_literal: true
class DropNamespaceIdOnlyIndexFromSentNotifications < Gitlab::Database::Migration[2.3]
INDEX_NAME = 'index_sent_notifications_on_namespace_id'
milestone '18.1'
def up
# Only created async in .com, no need to remove synchronously
prepare_async_index_removal :sent_notifications, :namespace_id, name: INDEX_NAME
end
def down
unprepare_async_index :sent_notifications, :namespace_id, name: INDEX_NAME
end
end
# frozen_string_literal: true
class PrepareAsyncIndexSentNotificationsNamespaceIdAndId < Gitlab::Database::Migration[2.3]
INDEX_NAME = 'idx_sent_notifications_on_namespace_id_and_id'
milestone '18.1'
# TODO: Index to be created synchronously in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/192248
def up
prepare_async_index :sent_notifications, [:namespace_id, :id], name: INDEX_NAME # rubocop:disable Migration/PreventIndexCreation -- Necessary for sharding key
end
def down
unprepare_async_index :sent_notifications, [:namespace_id, :id], name: INDEX_NAME
end
end
5f752aa1fab01ae485105f0bc61b9511511168b7cc7914ecf68ae4f28a8bdeeb
\ No newline at end of file
9ee6ff5125a6989598e95184dd5cfd509b458d2f7fed2e61256c2f3b9569e870
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment