Remove foreign key constraint from devices to sessions
Devices should persist independently of sessions - when a session is deleted, the device registration should remain valid. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,7 @@ class CreateActionPushNativeDevices < ActiveRecord::Migration[8.0]
|
||||
t.string :platform, null: false
|
||||
t.string :token, null: false
|
||||
t.belongs_to :owner, polymorphic: true, type: :uuid, index: false
|
||||
t.belongs_to :session, type: :uuid, foreign_key: true
|
||||
t.belongs_to :session, type: :uuid
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
Generated
-2
@@ -853,6 +853,4 @@ ActiveRecord::Schema[8.2].define(version: 2026_02_18_120000) do
|
||||
t.index ["account_id"], name: "index_webhooks_on_account_id"
|
||||
t.index ["board_id", "subscribed_actions"], name: "index_webhooks_on_board_id_and_subscribed_actions", length: { subscribed_actions: 255 }
|
||||
end
|
||||
|
||||
add_foreign_key "action_push_native_devices", "sessions"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user