From 8a77fd7966a3d0ef77b7bb40508bad8587132806 Mon Sep 17 00:00:00 2001 From: Rosa Gutierrez Date: Wed, 21 Jan 2026 20:50:57 +0100 Subject: [PATCH] Squash device migrations into single table creation Consolidates the session reference and index cleanup into the original CreateActionPushNativeDevices migration for a cleaner migration history. Co-Authored-By: Claude Opus 4.5 --- .../20260114203313_create_action_push_native_devices.rb | 3 ++- ...260121184815_add_session_to_action_push_native_devices.rb | 5 ----- ..._redundant_owner_index_from_action_push_native_devices.rb | 5 ----- 3 files changed, 2 insertions(+), 11 deletions(-) delete mode 100644 db/migrate/20260121184815_add_session_to_action_push_native_devices.rb delete mode 100644 db/migrate/20260121194404_remove_redundant_owner_index_from_action_push_native_devices.rb diff --git a/db/migrate/20260114203313_create_action_push_native_devices.rb b/db/migrate/20260114203313_create_action_push_native_devices.rb index 5ef4be322..4985c8636 100644 --- a/db/migrate/20260114203313_create_action_push_native_devices.rb +++ b/db/migrate/20260114203313_create_action_push_native_devices.rb @@ -4,7 +4,8 @@ class CreateActionPushNativeDevices < ActiveRecord::Migration[8.0] t.string :name t.string :platform, null: false t.string :token, null: false - t.belongs_to :owner, polymorphic: true, type: :uuid + t.belongs_to :owner, polymorphic: true, type: :uuid, index: false + t.belongs_to :session, type: :uuid, foreign_key: true t.timestamps end diff --git a/db/migrate/20260121184815_add_session_to_action_push_native_devices.rb b/db/migrate/20260121184815_add_session_to_action_push_native_devices.rb deleted file mode 100644 index e255f2eb3..000000000 --- a/db/migrate/20260121184815_add_session_to_action_push_native_devices.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddSessionToActionPushNativeDevices < ActiveRecord::Migration[8.2] - def change - add_reference :action_push_native_devices, :session, foreign_key: true, type: :uuid - end -end diff --git a/db/migrate/20260121194404_remove_redundant_owner_index_from_action_push_native_devices.rb b/db/migrate/20260121194404_remove_redundant_owner_index_from_action_push_native_devices.rb deleted file mode 100644 index 3c1392b44..000000000 --- a/db/migrate/20260121194404_remove_redundant_owner_index_from_action_push_native_devices.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RemoveRedundantOwnerIndexFromActionPushNativeDevices < ActiveRecord::Migration[8.2] - def change - remove_index :action_push_native_devices, column: [ :owner_type, :owner_id ] - end -end