Commit 27f5297f authored by alinamihaila's avatar alinamihaila

Add correct index

parent b3bda708
......@@ -9,10 +9,10 @@ class AddIndexOnIdAndLdapKeyToKeys < ActiveRecord::Migration[6.0]
disable_ddl_transaction!
def up
add_concurrent_index :keys, [:id, :type], where: "type = 'LDAPKey'", name: INDEX_NAME
add_concurrent_index :keys, [:id], where: "type = 'LDAPKey'", name: INDEX_NAME
end
def down
remove_concurrent_index :keys, INDEX_NAME
remove_concurrent_index_by_name :keys, INDEX_NAME
end
end
......@@ -2309,8 +2309,8 @@ ActiveRecord::Schema.define(version: 2020_03_16_111759) do
t.datetime_with_timezone "expires_at"
t.index ["fingerprint"], name: "index_keys_on_fingerprint", unique: true
t.index ["fingerprint_sha256"], name: "index_keys_on_fingerprint_sha256"
t.index ["id", "type"], name: "index_keys_on_id_and_ldap_key_type", where: "((type)::text = 'LDAPKey'::text)"
t.index ["id", "type"], name: "index_on_deploy_keys_id_and_type_and_public", unique: true, where: "(public = true)"
t.index ["id"], name: "index_keys_on_id_and_ldap_key_type", where: "((type)::text = 'LDAPKey'::text)"
t.index ["last_used_at"], name: "index_keys_on_last_used_at", order: "DESC NULLS LAST"
t.index ["user_id"], name: "index_keys_on_user_id"
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