Open maxachis opened 1 month ago
This is a good idea—probably made easier by the database_client
?
This is a good idea—probably made easier by the
database_client
?
Oh yes, very much easier. The separation of concerns makes it much easier to consolidate at the middleware, database, or even Resource level.
When creating a view in SQL (or at least PostgreSQL), all column names must be unique. Previously, some column names were the same (for example, both data_sources
and agencies
have a last_approval_editor
, so queries which selected both had two columns named last_approval_editor
). That can't be done in a view, so they'll need to be modified in some way. Any code which is expecting an exact match on those columns will break.
(In some cases, such as last_approval_editor
, we may want to eventually normalize them to a separate table called approval_information
or something like that, which can indicate approval/rejection information for all things that we can approve or reject, including agencies and data sources).
./data-sources
name
column changed to data_source_name
submitted_name
column changed to data_source_submitted_name
last_approval_editor
changed to data_source_last_approval_editor
Data sources logic as it currently exists is redundant, with multiple endpoints performing considerably similar functions and operating out of different endpoints.
To give an example, the
data-sources-need-identification
endpoint and thedata-sources-map
endpoints all retrieve variants of the data retrieved viadata-sources
. However, considerable portions of the backend logic are separate where they could be consolidated for easier maintainability. A few ideas include:This one is more open ended, motivated more by an awareness of redundancies in the backend, rather than any specific prescription.
TODO