From e99f9b5c17e225fc2105d5928dea85ade42d22ef Mon Sep 17 00:00:00 2001 From: Martin Date: Thu, 9 Nov 2023 20:06:51 +0100 Subject: [PATCH] amelioration(data): ajoute un index sur users.last_signed_in_at --- ...0231109190504_add_index_to_userss_on_last_sign_in_at.rb | 7 +++++++ db/schema.rb | 1 + 2 files changed, 8 insertions(+) create mode 100644 db/migrate/20231109190504_add_index_to_userss_on_last_sign_in_at.rb diff --git a/db/migrate/20231109190504_add_index_to_userss_on_last_sign_in_at.rb b/db/migrate/20231109190504_add_index_to_userss_on_last_sign_in_at.rb new file mode 100644 index 000000000..09618f56d --- /dev/null +++ b/db/migrate/20231109190504_add_index_to_userss_on_last_sign_in_at.rb @@ -0,0 +1,7 @@ +class AddIndexToUserssOnLastSignInAt < ActiveRecord::Migration[7.0] + disable_ddl_transaction! + + def change + add_index :users, :last_sign_in_at, algorithm: :concurrently + end +end diff --git a/db/schema.rb b/db/schema.rb index 7c78971ab..a708e3424 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1072,6 +1072,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_11_14_113317) do t.datetime "updated_at", precision: 6 t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true t.index ["email"], name: "index_users_on_email", unique: true + t.index ["last_sign_in_at"], name: "index_users_on_last_sign_in_at" t.index ["requested_merge_into_id"], name: "index_users_on_requested_merge_into_id" t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true t.index ["unlock_token"], name: "index_users_on_unlock_token", unique: true