Commit 849927a1 authored by James Fargher's avatar James Fargher

Move ChatOps migrations to Core

parent 69df085e
# See http://doc.gitlab.com/ce/development/migration_style_guide.html # frozen_string_literal: true
# for more information on how to write migrations for GitLab.
class CreateChatopsTables < ActiveRecord::Migration[4.2] class CreateChatopsTables < ActiveRecord::Migration[4.2]
include Gitlab::Database::MigrationHelpers include Gitlab::Database::MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME = false DOWNTIME = false
def change def change
...@@ -16,6 +14,8 @@ class CreateChatopsTables < ActiveRecord::Migration[4.2] ...@@ -16,6 +14,8 @@ class CreateChatopsTables < ActiveRecord::Migration[4.2]
# A pipeline can only contain one row in this table, hence this index is # A pipeline can only contain one row in this table, hence this index is
# unique. # unique.
t.index :pipeline_id, unique: true t.index :pipeline_id, unique: true
t.index :chat_name_id
end end
# rubocop:disable Migration/AddConcurrentForeignKey # rubocop:disable Migration/AddConcurrentForeignKey
......
...@@ -12,7 +12,11 @@ class AddMissingIndexesForForeignKeysEE < ActiveRecord::Migration[4.2] ...@@ -12,7 +12,11 @@ class AddMissingIndexesForForeignKeysEE < ActiveRecord::Migration[4.2]
add_concurrent_index(:application_settings, :custom_project_templates_group_id) add_concurrent_index(:application_settings, :custom_project_templates_group_id)
add_concurrent_index(:board_assignees, :assignee_id) add_concurrent_index(:board_assignees, :assignee_id)
add_concurrent_index(:board_labels, :label_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(:geo_node_namespace_links, :namespace_id)
add_concurrent_index(:namespaces, :file_template_project_id) add_concurrent_index(:namespaces, :file_template_project_id)
add_concurrent_index(:protected_branch_merge_access_levels, :group_id) add_concurrent_index(:protected_branch_merge_access_levels, :group_id)
...@@ -29,7 +33,6 @@ class AddMissingIndexesForForeignKeysEE < ActiveRecord::Migration[4.2] ...@@ -29,7 +33,6 @@ class AddMissingIndexesForForeignKeysEE < ActiveRecord::Migration[4.2]
remove_concurrent_index(:application_settings, :custom_project_templates_group_id) remove_concurrent_index(:application_settings, :custom_project_templates_group_id)
remove_concurrent_index(:board_assignees, :assignee_id) remove_concurrent_index(:board_assignees, :assignee_id)
remove_concurrent_index(:board_labels, :label_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(:geo_node_namespace_links, :namespace_id)
remove_concurrent_index(:namespaces, :file_template_project_id) remove_concurrent_index(:namespaces, :file_template_project_id)
remove_concurrent_index(:protected_branch_merge_access_levels, :group_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