Commit 3050da47 authored by Tiger Watson's avatar Tiger Watson

Merge branch 'mwaw/add_index_to_events_table' into 'master'

Add index on events using created at and id  to support UMAU metric

See merge request gitlab-org/gitlab!73273
parents 5f4df28b 8b781a35
# frozen_string_literal: true
class AddAsyncIndexOnEventsUsingBtreeCreatedAtId < Gitlab::Database::Migration[1.0]
INDEX_NAME = 'index_events_on_created_at_and_id'
TABLE = :events
COLUMNS = %i[created_at id]
CONSTRAINTS = "created_at > '2021-08-27'"
def up
prepare_async_index TABLE, COLUMNS, name: INDEX_NAME, where: CONSTRAINTS
end
def down
unprepare_async_index TABLE, COLUMNS, name: INDEX_NAME, where: CONSTRAINTS
end
end
d7655fb2a01e389f59990b395ed7ef683b21a3371b7e68d3eb29def85eea1888
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment