Commit 86331c07 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'nicolasdular/change-broadcast-index' into 'master'

Change broadcast message index

See merge request gitlab-org/gitlab!23986
parents 8edef40c 3121dc37
---
title: Change broadcast message index
merge_request: 23986
author:
type: performance
# frozen_string_literal: true
class ChangeBroadcastMessageIndex < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :broadcast_messages, %i(ends_at broadcast_type id), name: 'index_broadcast_message_on_ends_at_and_broadcast_type_and_id'
remove_concurrent_index_by_name :broadcast_messages, :index_broadcast_messages_on_starts_at_and_ends_at_and_id
end
def down
add_concurrent_index :broadcast_messages, %i(starts_at ends_at id), name: 'index_broadcast_messages_on_starts_at_and_ends_at_and_id'
remove_concurrent_index_by_name :broadcast_messages, :index_broadcast_message_on_ends_at_and_broadcast_type_and_id
end
end
......@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2020_02_03_025821) do
ActiveRecord::Schema.define(version: 2020_02_04_131054) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
......@@ -564,7 +564,7 @@ ActiveRecord::Schema.define(version: 2020_02_03_025821) do
t.integer "cached_markdown_version"
t.string "target_path", limit: 255
t.integer "broadcast_type", limit: 2, default: 1, null: false
t.index ["starts_at", "ends_at", "id"], name: "index_broadcast_messages_on_starts_at_and_ends_at_and_id"
t.index ["ends_at", "broadcast_type", "id"], name: "index_broadcast_message_on_ends_at_and_broadcast_type_and_id"
end
create_table "chat_names", id: :serial, force: :cascade do |t|
......
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