Add index to the project_registry table

parent a1fc1593
class AddIndexToProjectRegistry < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :project_registry, :last_repository_synced_at
add_concurrent_index :project_registry, :last_repository_successful_sync_at
add_concurrent_index :project_registry, :resync_repository
add_concurrent_index :project_registry, :resync_wiki
end
def down
remove_concurrent_index :project_registry, :last_repository_synced_at if index_exists?(:project_registry, :last_repository_synced_at)
remove_concurrent_index :project_registry, :last_repository_successful_sync_at if index_exists?(:project_registry, :last_repository_successful_sync_at)
remove_concurrent_index :project_registry, :resync_repository if index_exists?(:project_registry, :resync_repository)
remove_concurrent_index :project_registry, :resync_wiki if index_exists?(:project_registry, :resync_wiki)
end
end
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170614201943) do ActiveRecord::Schema.define(version: 20170627195211) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
...@@ -41,6 +41,10 @@ ActiveRecord::Schema.define(version: 20170614201943) do ...@@ -41,6 +41,10 @@ ActiveRecord::Schema.define(version: 20170614201943) do
t.datetime "last_wiki_successful_sync_at" t.datetime "last_wiki_successful_sync_at"
end end
add_index "project_registry", ["last_repository_successful_sync_at"], name: "index_project_registry_on_last_repository_successful_sync_at", using: :btree
add_index "project_registry", ["last_repository_synced_at"], name: "index_project_registry_on_last_repository_synced_at", using: :btree
add_index "project_registry", ["project_id"], name: "index_project_registry_on_project_id", using: :btree add_index "project_registry", ["project_id"], name: "index_project_registry_on_project_id", using: :btree
add_index "project_registry", ["resync_repository"], name: "index_project_registry_on_resync_repository", using: :btree
add_index "project_registry", ["resync_wiki"], name: "index_project_registry_on_resync_wiki", using: :btree
end end
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