Commit 7f59182d authored by Mark Chao's avatar Mark Chao

Index elasticsearch_indexed_namespaces created_at

For find latest inserted records to rollback
parent 5c0b3a27
# frozen_string_literal: true
class AddIndexToElasticsearchIndexedNamespaces < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index(:elasticsearch_indexed_namespaces, :created_at)
end
def down
remove_concurrent_index(:elasticsearch_indexed_namespaces, :created_at)
end
end
...@@ -1460,6 +1460,7 @@ ActiveRecord::Schema.define(version: 2020_01_02_170221) do ...@@ -1460,6 +1460,7 @@ ActiveRecord::Schema.define(version: 2020_01_02_170221) do
t.datetime_with_timezone "created_at", null: false t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false t.datetime_with_timezone "updated_at", null: false
t.integer "namespace_id" t.integer "namespace_id"
t.index ["created_at"], name: "index_elasticsearch_indexed_namespaces_on_created_at"
t.index ["namespace_id"], name: "index_elasticsearch_indexed_namespaces_on_namespace_id", unique: true t.index ["namespace_id"], name: "index_elasticsearch_indexed_namespaces_on_namespace_id", unique: true
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