-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CV2-3680: Store tipline messages we send (#1664)
* CV2-3680: store tipline messages we sent * CV2-3680: remove external_id uniqueness validation * CV2-3680: fix tests and add more tests * CV2-3680: apply PR comments * CV2-3680: fix tests * CV2-3680: fix platform fallback
- Loading branch information
Showing
11 changed files
with
334 additions
and
259 deletions.
There are no files selected for viewing
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
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
11 changes: 11 additions & 0 deletions
11
db/migrate/20230920055719_add_state_column_to_tipline_message.rb
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class AddStateColumnToTiplineMessage < ActiveRecord::Migration[6.1] | ||
def change | ||
add_column :tipline_messages, :state, :string | ||
# remove uniq index | ||
remove_index :tipline_messages, name: "index_tipline_messages_on_external_id" | ||
# updated state for existing records | ||
TiplineMessage.where(direction: "incoming", state: nil).update_all(state: 'received') | ||
TiplineMessage.where(direction: "outgoing", state: nil).update_all(state: 'delivered') | ||
add_index :tipline_messages, [:external_id, :state], unique: true | ||
end | ||
end |
Oops, something went wrong.