1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 05:09:38 +02:00

perf: Add index to sync status (#2337)

* - Add index to sync status

* - revert typo

* - revert unrelated schema.rb change
This commit is contained in:
Iuri G. 2025-06-09 09:18:52 -05:00 committed by GitHub
parent 9f6c9b4057
commit 1d2e7fcae0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View file

@ -0,0 +1,7 @@
class AddIndexToSyncStatus < ActiveRecord::Migration[7.2]
disable_ddl_transaction!
def change
add_index :syncs, :status, if_not_exists: true, algorithm: :concurrently
end
end

3
db/schema.rb generated
View file

@ -10,7 +10,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[7.2].define(version: 2025_05_23_131455) do ActiveRecord::Schema[7.2].define(version: 2025_06_05_031616) 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 "pgcrypto" enable_extension "pgcrypto"
enable_extension "plpgsql" enable_extension "plpgsql"
@ -593,6 +593,7 @@ ActiveRecord::Schema[7.2].define(version: 2025_05_23_131455) do
t.date "window_start_date" t.date "window_start_date"
t.date "window_end_date" t.date "window_end_date"
t.index ["parent_id"], name: "index_syncs_on_parent_id" t.index ["parent_id"], name: "index_syncs_on_parent_id"
t.index ["status"], name: "index_syncs_on_status"
t.index ["syncable_type", "syncable_id"], name: "index_syncs_on_syncable" t.index ["syncable_type", "syncable_id"], name: "index_syncs_on_syncable"
end end