Commit f89cd80
adding an initializer preventing create partition statements from get… (#5737)
…ting into structure.sql
**Story card:**
[sc-17444](https://app.shortcut.com/simpledotorg/story/17444/exclude-reporting-patient-states-partitions-from-appearing-into-structure-sql)
## Because
We have a partitioned table reporting_patient_states.
Every time we do a reporting refresh, partitions gets created
dynamically on this table (if they don't already exist).
These partitions appear on structure.sql as well with something like
CREATE TABLE simple_reporting.reporting_patient_states_20180101 (
These create partition statements are not really needed in structure.sql
because
These partitions are created dynamically through the rake task, if one
doesn't exist
Having a create statement for each partition makes the file very messy
and unnecessarily long.
We need to get rid of these create statements from getting into the
file.
## This addresses
Adding an initializer which has 'exclude-table' param to ignore these
partition create statements from appearing into dump
## Test instructions
Run rake db:refresh_reporting_views - this will create some partitions
on reporting_patient_states
Run rails db:migrate
Verify structure.sql, create with individual partitions should not be a
part of it.
---------
Co-authored-by: Ayushi Agrawal <[email protected]>1 parent d45eb6a commit f89cd80
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments