diff options
author | Alex Groleau <agroleau@gitlab.com> | 2019-08-27 12:41:39 -0400 |
---|---|---|
committer | Alex Groleau <agroleau@gitlab.com> | 2019-08-27 12:41:39 -0400 |
commit | aa01f092829facd1044ad02f334422b7dbdc8b0e (patch) | |
tree | a754bf2497820432df7da0f2108bb7527a8dd7b8 /db/migrate/20190815093936_add_index_notes_on_project_id_and_id_and_system_false.rb | |
parent | a1d9c9994a9a4d79b824c3fd9322688303ac8b03 (diff) | |
parent | 6b10779053ff4233c7a64c5ab57754fce63f6710 (diff) | |
download | gitlab-ce-aa01f092829facd1044ad02f334422b7dbdc8b0e.tar.gz |
Merge branch 'master' of gitlab_gitlab:gitlab-org/gitlab-cerunner-metrics-extractor
Diffstat (limited to 'db/migrate/20190815093936_add_index_notes_on_project_id_and_id_and_system_false.rb')
-rw-r--r-- | db/migrate/20190815093936_add_index_notes_on_project_id_and_id_and_system_false.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/db/migrate/20190815093936_add_index_notes_on_project_id_and_id_and_system_false.rb b/db/migrate/20190815093936_add_index_notes_on_project_id_and_id_and_system_false.rb new file mode 100644 index 00000000000..cbbece35901 --- /dev/null +++ b/db/migrate/20190815093936_add_index_notes_on_project_id_and_id_and_system_false.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +class AddIndexNotesOnProjectIdAndIdAndSystemFalse < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index(*index_arguments) + end + + def down + remove_concurrent_index(*index_arguments) + end + + private + + def index_arguments + [ + :notes, + [:project_id, :id], + { + name: 'index_notes_on_project_id_and_id_and_system_false', + where: 'NOT system' + } + ] + end +end |