From dfdff16c4e20656e525b0680c87baf98fc5c9bfb Mon Sep 17 00:00:00 2001 From: Max Wofford Date: Wed, 7 May 2025 14:48:46 -0400 Subject: [PATCH] Remove old index that ignored deleted field --- ...0250507184341_remove_fields_hash_index_from_heartbeats.rb | 5 +++++ db/schema.rb | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20250507184341_remove_fields_hash_index_from_heartbeats.rb diff --git a/db/migrate/20250507184341_remove_fields_hash_index_from_heartbeats.rb b/db/migrate/20250507184341_remove_fields_hash_index_from_heartbeats.rb new file mode 100644 index 0000000..133923d --- /dev/null +++ b/db/migrate/20250507184341_remove_fields_hash_index_from_heartbeats.rb @@ -0,0 +1,5 @@ +class RemoveFieldsHashIndexFromHeartbeats < ActiveRecord::Migration[8.0] + def change + remove_index :heartbeats, name: "index_heartbeats_on_fields_hash" + end +end diff --git a/db/schema.rb b/db/schema.rb index b331ca6..774a2a7 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[8.0].define(version: 2025_05_07_183451) do +ActiveRecord::Schema[8.0].define(version: 2025_05_07_184341) do # These are extensions that must be enabled in order to support this database enable_extension "pg_catalog.plpgsql" @@ -209,7 +209,6 @@ ActiveRecord::Schema[8.0].define(version: 2025_05_07_183451) do t.integer "ysws_program", default: 0, null: false t.datetime "deleted_at" t.index ["category", "time"], name: "index_heartbeats_on_category_and_time" - t.index ["fields_hash"], name: "index_heartbeats_on_fields_hash", unique: true t.index ["fields_hash"], name: "index_heartbeats_on_fields_hash_when_not_deleted", unique: true, where: "(deleted_at IS NULL)" t.index ["user_id"], name: "index_heartbeats_on_user_id" end