Commit 32c56e07 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'ee-move_chatops_to_core_migration' into 'master'

Move ChatOps migrations to Core

See merge request gitlab-org/gitlab-ee!9472
parents 832408da 849927a1
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
# frozen_string_literal: true
class CreateChatopsTables < ActiveRecord::Migration[4.2]
include Gitlab::Database::MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME = false
def change
......@@ -16,6 +14,8 @@ class CreateChatopsTables < ActiveRecord::Migration[4.2]
# A pipeline can only contain one row in this table, hence this index is
# unique.
t.index :pipeline_id, unique: true
t.index :chat_name_id
end
# rubocop:disable Migration/AddConcurrentForeignKey
......
......@@ -12,7 +12,11 @@ class AddMissingIndexesForForeignKeysEE < ActiveRecord::Migration[4.2]
add_concurrent_index(:application_settings, :custom_project_templates_group_id)
add_concurrent_index(:board_assignees, :assignee_id)
add_concurrent_index(:board_labels, :label_id)
add_concurrent_index(:ci_pipeline_chat_data, :chat_name_id)
# This index has been hoisted up to `20180209115333_create_chatops_tables.rb`
# so that it could be ported to Core without breaking upgrades
add_concurrent_index(:ci_pipeline_chat_data, :chat_name_id) unless index_exists?(:ci_pipeline_chat_data, :chat_name_id)
add_concurrent_index(:geo_node_namespace_links, :namespace_id)
add_concurrent_index(:namespaces, :file_template_project_id)
add_concurrent_index(:protected_branch_merge_access_levels, :group_id)
......@@ -29,7 +33,6 @@ class AddMissingIndexesForForeignKeysEE < ActiveRecord::Migration[4.2]
remove_concurrent_index(:application_settings, :custom_project_templates_group_id)
remove_concurrent_index(:board_assignees, :assignee_id)
remove_concurrent_index(:board_labels, :label_id)
remove_concurrent_index(:ci_pipeline_chat_data, :chat_name_id)
remove_concurrent_index(:geo_node_namespace_links, :namespace_id)
remove_concurrent_index(:namespaces, :file_template_project_id)
remove_concurrent_index(:protected_branch_merge_access_levels, :group_id)
......
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