chore: "Channel::TwilioSms" to be unique on account_sid+phone_number (#4188)

"Twilio::IncomingMessageService" searches for the correct "Channel::TwilioSms"
by account_sid+phone_number.  If these values are duplicated then which record it
finds is indeterminate and may alternate between queries.

Co-authored-by: Sojan Jose <sojan@pepalo.com>
This commit is contained in:
Jordan Brough
2022-05-07 06:27:16 -06:00
committed by GitHub
parent 2e0d43c093
commit 5b5a6d89c0
3 changed files with 46 additions and 3 deletions

View File

@@ -257,7 +257,8 @@ ActiveRecord::Schema.define(version: 2022_04_28_101325) do
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.integer "medium", default: 0
t.index ["account_id", "phone_number"], name: "index_channel_twilio_sms_on_account_id_and_phone_number", unique: true
t.index ["account_sid", "phone_number"], name: "index_channel_twilio_sms_on_account_sid_and_phone_number", unique: true
t.index ["phone_number"], name: "index_channel_twilio_sms_on_phone_number", unique: true
end
create_table "channel_twitter_profiles", force: :cascade do |t|