Skip to content

Commit 70bfcdc

Browse files
aagrawalrtslAyushi Agrawal
andauthored
removing mat view fro reporting_facility_states (#5807)
**Story card:** [SIMPLEBACK-117](https://rtsl.atlassian.net/browse/SIMPLEBACK-117) ## Because We want to discard materialized reporting_facility_states ## This addresses We create a normal view reporting_facility_states under public schema. This will ensure that the existing dashboard and metabase reports don't break. ## Test instructions Clear the cache and restart the server. The dashboards should load fine. Suite tests. --------- Co-authored-by: Ayushi Agrawal <ayushiagrawal@RTSL-P172G93770.local>
1 parent bad93f7 commit 70bfcdc

28 files changed

Lines changed: 475 additions & 2126 deletions

app/models/reports/facility_state.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class FacilityState < Reports::View
55
belongs_to :facility
66

77
def self.materialized?
8-
true
8+
false
99
end
1010

1111
def self.partitioned?

db/migrate/20260513141718_discard_mat_view_reporting_facility_states.rb

Lines changed: 370 additions & 0 deletions
Large diffs are not rendered by default.

db/structure.sql

Lines changed: 6 additions & 347 deletions
Large diffs are not rendered by default.

db/views/reporting_facility_states_v10.sql

Lines changed: 0 additions & 277 deletions
This file was deleted.

db/views/reporting_facility_states_v11.sql

Lines changed: 0 additions & 339 deletions
This file was deleted.

db/views/reporting_facility_states_v12.sql

Lines changed: 0 additions & 345 deletions
This file was deleted.

db/views/reporting_facility_states_v13.sql

Lines changed: 0 additions & 405 deletions
This file was deleted.

db/views/reporting_facility_states_v14.sql

Lines changed: 0 additions & 404 deletions
This file was deleted.

lib/tasks/reporting.rake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ namespace :reporting do
3131
reporting_prescriptions
3232
reporting_patient_follow_ups
3333
reporting_facility_appointment_scheduled_days
34-
reporting_facility_states
3534
reporting_facility_daily_follow_ups_and_registrations
3635
].freeze
3736
views_to_refresh =

spec/controllers/my_facilities_controller_spec.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
end
3636
Timecop.freeze("January 15th 2021") do
3737
allow(Reports::PatientState).to receive(:get_refresh_months).and_return(ReportingHelpers.get_refresh_months_between_dates(Date.new(2020, 11, 1), Date.today))
38+
allow(Reports::FacilityState).to receive(:get_refresh_months).and_return(ReportingHelpers.get_refresh_months_between_dates(Date.new(2020, 11, 1), Date.today))
3839
refresh_views
3940
get :bp_controlled, params: {}
4041
end
@@ -87,6 +88,7 @@
8788

8889
Timecop.freeze("January 15th 2021") do
8990
allow(Reports::PatientState).to receive(:get_refresh_months).and_return(ReportingHelpers.get_refresh_months_between_dates(Date.new(2020, 11, 1), Date.today))
91+
allow(Reports::FacilityState).to receive(:get_refresh_months).and_return(ReportingHelpers.get_refresh_months_between_dates(Date.new(2020, 11, 1), Date.today))
9092
refresh_views
9193
get :bp_not_controlled, params: {}
9294
end
@@ -154,6 +156,7 @@
154156
end
155157
Timecop.freeze("January 15th 2021") do
156158
allow(Reports::PatientState).to receive(:get_refresh_months).and_return(ReportingHelpers.get_refresh_months_between_dates(Date.new(2020, 7, 1), Date.today))
159+
allow(Reports::FacilityState).to receive(:get_refresh_months).and_return(ReportingHelpers.get_refresh_months_between_dates(Date.new(2020, 7, 1), Date.today))
157160
refresh_views
158161
get :csv_maker, params: {type: "controlled_patients"}
159162
end

0 commit comments

Comments
 (0)