Skip to content

Commit 354c7bb

Browse files
authored
Cancel upcoming BD SMSs (#5528)
**Story card:** [sc-14668](https://app.shortcut.com/simpledotorg/story/14668/delete-all-upcoming-bd-notifications-for-stale-patients) ## Because Stale patient experiments use up credit meant for current patients ## This addresses Cancelling the experiments for stale patients ## Test instructions 1. Ran the underlying SQL in metabase to confirm the set 1. Ran the query (without the `destroy`) in prod to match (1)
1 parent 99556b8 commit 354c7bb

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# frozen_string_literal: true
2+
3+
class CancelBangladeshStaleExperiments < ActiveRecord::Migration[6.1]
4+
def up
5+
return unless CountryConfig.current_country?("Bangladesh") && SimpleServer.env.production?
6+
Experimentation::Experiment.upcoming.where(experiment_type: "stale_patients").each do |experiment|
7+
experiment.destroy # ...because we need the associated notifications gone too
8+
end
9+
end
10+
11+
def down
12+
raise ActiveRecord::IrreversibleMigration
13+
end
14+
end

db/data_schema.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
DataMigrate::Data.define(version: 20240902213036)
1+
DataMigrate::Data.define(version: 20250204101724)

0 commit comments

Comments
 (0)