This repository has been archived by the owner on Jul 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 84
Support multiple from numbers for system SMS configs #1312
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
google-cla
bot
added
the
cla: yes
Auto: added by CLA bot when all committers have signed a CLA.
label
Dec 10, 2020
sethvargo
force-pushed
the
sethvargo/multi_sms
branch
from
December 10, 2020 04:12
3aef572
to
d088272
Compare
sethvargo
commented
Dec 10, 2020
value TEXT UNIQUE | ||
)`, | ||
`ALTER TABLE realms ADD COLUMN IF NOT EXISTS sms_from_number_id INTEGER`, | ||
`ALTER TABLE realms ADD CONSTRAINT fk_sms_from_number FOREIGN KEY (sms_from_number_id) REFERENCES sms_from_numbers(id)`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approximately here is where I lost 4 hours to gorm + AutoMigrate.
func (db *Database) CreateOrUpdateSMSFromNumbers(numbers []*SMSFromNumber) error { | ||
ids := make([]uint, 0, len(numbers)) | ||
|
||
return db.db.Transaction(func(tx *gorm.DB) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'm also crying a little bit here.
This gives system administrators the ability to define a list of available SMS phone numbers. When the system SMS configuration is shared with a realm, the realm can choose the phone number from which they want to send messages.
sethvargo
force-pushed
the
sethvargo/multi_sms
branch
from
December 10, 2020 04:14
d088272
to
a69cbf6
Compare
/assign @mikehelmick |
whaught
approved these changes
Dec 10, 2020
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sethvargo, whaught The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This gives system administrators the ability to define a list of available SMS phone numbers. When the system SMS configuration is shared with a realm, the realm can choose the phone number from which they want to send messages.
Not pictured: the 6 hours I spent fighting gorm.
Fixes #1291
Release Note