Add missing indexes to geo_event_log table

parent e5e3f88e
class AddMissingIndexesToGeoEventLog < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :geo_event_log, :repositories_changed_event_id
add_concurrent_index :geo_event_log, :repository_deleted_event_id
add_concurrent_index :geo_event_log, :repository_renamed_event_id
end
def down
remove_concurrent_index :geo_event_log, :repositories_changed_event_id if index_exists? :geo_event_log, :repositories_changed_event_id
remove_concurrent_index :geo_event_log, :repository_deleted_event_id if index_exists? :geo_event_log, :repository_deleted_event_id
remove_concurrent_index :geo_event_log, :repository_renamed_event_id if index_exists? :geo_event_log, :repository_renamed_event_id
end
end
......@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170824162758) do
ActiveRecord::Schema.define(version: 20170905202320) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
......@@ -671,6 +671,9 @@ ActiveRecord::Schema.define(version: 20170824162758) do
t.integer "repositories_changed_event_id", limit: 8
end
add_index "geo_event_log", ["repositories_changed_event_id"], name: "index_geo_event_log_on_repositories_changed_event_id", using: :btree
add_index "geo_event_log", ["repository_deleted_event_id"], name: "index_geo_event_log_on_repository_deleted_event_id", using: :btree
add_index "geo_event_log", ["repository_renamed_event_id"], name: "index_geo_event_log_on_repository_renamed_event_id", using: :btree
add_index "geo_event_log", ["repository_updated_event_id"], name: "index_geo_event_log_on_repository_updated_event_id", using: :btree
create_table "geo_node_namespace_links", 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