Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue 1166] Create tables for expanded opportunity data model #1187

Merged
merged 8 commits into from
Feb 9, 2024

Conversation

chouinar
Copy link
Collaborator

@chouinar chouinar commented Feb 7, 2024

Summary

Fixes #1166

This requires #1136 to be merged first as it builds ontop of that work

Time to review: 5 mins

Changes proposed

Created the opportunity tables for the expanded data model
https://app.gitbook.com/o/cFcvhi6d0nlLyH2VzVgn/s/v1V0jIH7mb7Yb3jlNrgk/engineering/learnings/opportunity-endpoint-data-model#overview

Setup factories to generate data in a reasonable way for these tables

Context for reviewers

This sets up all of the tables for our expanded opportunity data model - tables we'll copy to for DMS that will later be transformed to these tables will be a separate PR.

The factories try to make somewhat realistic data with some variability.

Note that I did adjust a few things from the tech spec, which I just haven't changed in that document yet (can't merge the changes myself)

  • The other_value fields in the link tables actually make sense to stay in the summary table, I found examples of them working different than I had assumed, so it makes more sense to keep them in a general place.
  • The opportunity_agency table idea I've dropped - if we want to adjust how agency data is stored, will deal with it later when we deal with the rest of the agency data
  • Didn't adjust the primary keys - just keeping everything on opportunity_id - already was going to keep several that way - don't see a reason to have several different primary/foreign key setups.
  • Miscellaneous small renames to more closely match the design of the front-end

Additional information

Running make db-seed-local after the migrations shows the data in various tables in what I would expect:
Screenshot 2024-02-07 at 12 55 48 PM
Screenshot 2024-02-07 at 12 56 14 PM
Screenshot 2024-02-07 at 12 56 21 PM
Screenshot 2024-02-07 at 12 56 26 PM
Screenshot 2024-02-07 at 12 56 44 PM

@chouinar chouinar requested review from acouch and jamesbursa February 7, 2024 17:58
@github-actions github-actions bot added documentation Improvements or additions to documentation python api database labels Feb 7, 2024
Copy link
Collaborator

@jamesbursa jamesbursa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

api/src/constants/lookup_constants.py Outdated Show resolved Hide resolved
Base automatically changed from chouinar/lookup-setup to main February 9, 2024 17:04
@chouinar chouinar merged commit 196ad2f into main Feb 9, 2024
@chouinar chouinar deleted the chouinar/1166-opportunity-tables branch February 9, 2024 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api database documentation Improvements or additions to documentation python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task]: Add the database tables for the expanded data model
3 participants