diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-18 18:09:35 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-18 18:09:35 +0000 |
commit | 5bfb8d1fad825eec90b0af688c7cd1b352c9056e (patch) | |
tree | 385411919c4186d11a769385ad8dafeef6cc36a7 /db/post_migrate | |
parent | aaf59610548d9b0fd01acfd50e831cbe519ecba2 (diff) | |
download | gitlab-ce-5bfb8d1fad825eec90b0af688c7cd1b352c9056e.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/post_migrate')
-rw-r--r-- | db/post_migrate/20200212052620_readd_template_column_to_services.rb | 2 | ||||
-rw-r--r-- | db/post_migrate/20200311192351_add_index_on_noteable_type_and_noteable_id_to_sent_notifications.rb | 21 |
2 files changed, 23 insertions, 0 deletions
diff --git a/db/post_migrate/20200212052620_readd_template_column_to_services.rb b/db/post_migrate/20200212052620_readd_template_column_to_services.rb index e54b9e39277..2b0d26b2ad4 100644 --- a/db/post_migrate/20200212052620_readd_template_column_to_services.rb +++ b/db/post_migrate/20200212052620_readd_template_column_to_services.rb @@ -7,6 +7,7 @@ class ReaddTemplateColumnToServices < ActiveRecord::Migration[6.0] disable_ddl_transaction! + # rubocop:disable Migration/UpdateLargeTable def up return if column_exists? :services, :template @@ -16,6 +17,7 @@ class ReaddTemplateColumnToServices < ActiveRecord::Migration[6.0] # of `template`, we would look for entries with `project_id IS NULL`. add_column_with_default :services, :template, :boolean, default: false, allow_null: true end + # rubocop:enable Migration/UpdateLargeTable def down # NOP since the column is expected to exist diff --git a/db/post_migrate/20200311192351_add_index_on_noteable_type_and_noteable_id_to_sent_notifications.rb b/db/post_migrate/20200311192351_add_index_on_noteable_type_and_noteable_id_to_sent_notifications.rb new file mode 100644 index 00000000000..fa0246218c3 --- /dev/null +++ b/db/post_migrate/20200311192351_add_index_on_noteable_type_and_noteable_id_to_sent_notifications.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class AddIndexOnNoteableTypeAndNoteableIdToSentNotifications < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + INDEX_NAME = 'index_sent_notifications_on_noteable_type_noteable_id' + + disable_ddl_transaction! + + def up + add_concurrent_index :sent_notifications, + [:noteable_id], + name: INDEX_NAME, + where: "noteable_type = 'Issue'" + end + + def down + remove_concurrent_index_by_name :sent_notifications, INDEX_NAME + end +end |