diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-11-26 15:43:15 +0000 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2018-11-27 01:48:20 +0800 |
commit | c09fd53e54344bead8686a5c7fbb2da05bea0adc (patch) | |
tree | 1217bdc5e3517163b487ed28c7b0c810f11bd5d6 /db/migrate/20181126153547_remove_notes_index_on_updated_at.rb | |
parent | 890addcbf3362ffada5fc61daa28b40f06d3812c (diff) | |
download | gitlab-ce-c09fd53e54344bead8686a5c7fbb2da05bea0adc.tar.gz |
Remove notes index on updated_at
Diffstat (limited to 'db/migrate/20181126153547_remove_notes_index_on_updated_at.rb')
-rw-r--r-- | db/migrate/20181126153547_remove_notes_index_on_updated_at.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/db/migrate/20181126153547_remove_notes_index_on_updated_at.rb b/db/migrate/20181126153547_remove_notes_index_on_updated_at.rb new file mode 100644 index 00000000000..d7ca46b50e4 --- /dev/null +++ b/db/migrate/20181126153547_remove_notes_index_on_updated_at.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class RemoveNotesIndexOnUpdatedAt < ActiveRecord::Migration[5.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + remove_concurrent_index(*index_arguments) + end + + def down + add_concurrent_index(*index_arguments) + end + + private + + def index_arguments + [ + :notes, + [:updated_at], + { + name: 'index_notes_on_updated_at' + } + ] + end +end |