diff options
author | Robert Speicher <rspeicher@gmail.com> | 2019-03-06 21:05:55 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2019-03-06 21:05:55 +0300 |
commit | ce23d6e64d59a8fadcc86bb25a157607322b09e3 (patch) | |
tree | 5ff90a68311a3d9ef49096144127bb0555d9b900 /db | |
parent | 397ab0fba72f274cb86778a0de279f4ec88b988a (diff) |
Revert "Merge branch '54924-clean-up-data' into 'master'"
This reverts commit c9ecc71ab91b0b55f9aba632f9e7b305191a458c, reversing
changes made to c3c8dbf8fa4090bb090071d320a31857eb709d3d.
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20190228092516_clean_up_noteable_id_for_notes_on_commits.rb | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/db/migrate/20190228092516_clean_up_noteable_id_for_notes_on_commits.rb b/db/migrate/20190228092516_clean_up_noteable_id_for_notes_on_commits.rb deleted file mode 100644 index fe129e8f4dc..00000000000 --- a/db/migrate/20190228092516_clean_up_noteable_id_for_notes_on_commits.rb +++ /dev/null @@ -1,33 +0,0 @@ -# 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 CleanUpNoteableIdForNotesOnCommits < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - TEMP_INDEX_NAME = 'index_notes_on_commit_with_null_noteable_id' - - disable_ddl_transaction! - - def up - remove_concurrent_index_by_name(:notes, TEMP_INDEX_NAME) - - add_concurrent_index(:notes, :id, where: "noteable_type = 'Commit' AND noteable_id IS NOT NULL", name: TEMP_INDEX_NAME) - - # rubocop:disable Migration/UpdateLargeTable - update_column_in_batches(:notes, :noteable_id, nil) do |table, query| - query.where( - table[:noteable_type].eq('Commit').and(table[:noteable_id].not_eq(nil)) - ) - end - - remove_concurrent_index_by_name(:notes, TEMP_INDEX_NAME) - end - - def down - end -end |