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

Create tables for opportunity attachments #2123

Closed
3 tasks
acouch opened this issue Sep 17, 2024 · 0 comments · Fixed by #2483
Closed
3 tasks

Create tables for opportunity attachments #2123

acouch opened this issue Sep 17, 2024 · 0 comments · Fixed by #2483
Assignees
Labels
refinement topic: backend Backend development tickets

Comments

@acouch
Copy link
Collaborator

acouch commented Sep 17, 2024

We want to create the following two tables in our SQLAlchemy models:

Image

Only the created_by, updated_by, and legacy_folder_id columns should be nullable. Note you can use the python typing to dictate this. my_field: Mapped[int] is not nullable. my_field: Mapped[int | None] is nullable.


The lk_opportunity_attachment_type_id lookup table should follow our conventions for setting up a lookup table. We will only have two values at the moment for this lookup enum:

  • notice_of_funding_opportunity
  • other

See: https://github.com/navapbc/simpler-grants-gov/blob/main/documentation/api/lookup-values.md for further details on how this works.

Acceptance criteria

  • Tables created in our SQLAlchemy models
  • Migrations created via Alembic
  • Lookup table values configured (should auto-populate their table when running migrations)
@chouinar chouinar added this to the Search API - ELT Implementation milestone Sep 25, 2024
@chouinar chouinar moved this from Icebox to Sprint Ready in Simpler.Grants.gov Product Backlog Sep 25, 2024
@chouinar chouinar removed their assignment Sep 25, 2024
@mxk0 mxk0 changed the title [Task]: Create tables for opportunity attachments Create tables for opportunity attachments Oct 2, 2024
@mxk0 mxk0 added topic: backend Backend development tickets refinement and removed Migrated labels Oct 6, 2024
@mxk0 mxk0 mentioned this issue Oct 10, 2024
1 task
@mikehgrantsgov mikehgrantsgov self-assigned this Oct 15, 2024
mikehgrantsgov added a commit that referenced this issue Oct 17, 2024
## Summary
Fixes #2123

### Time to review: 10 mins

## Changes proposed
- Add models and supporting migrations for Opportunity attachments,
including lookup table for type.

## Context for reviewers
See generated migration and screenshots of result after db upgrade. 

Only the created_by, updated_by, and legacy_folder_id columns should be
nullable.

## Additional information
Screenshots of new tables after running `make db-upgrade`

<img width="1060" alt="Screenshot 2024-10-16 at 9 53 59 AM"
src="https://github.com/user-attachments/assets/58e6e8b6-e86f-40b8-a7b3-93524d794456">

<img width="1062" alt="Screenshot 2024-10-16 at 9 53 47 AM"
src="https://github.com/user-attachments/assets/692faac8-eefb-4845-b231-14ad403ddfad">

<img width="874" alt="Screenshot 2024-10-16 at 9 55 06 AM"
src="https://github.com/user-attachments/assets/e877a79e-15cc-4f1a-ac36-fb3fa4526515">

---------

Co-authored-by: Michael Huneke <[email protected]>
Co-authored-by: Michael Chouinard <[email protected]>
Co-authored-by: nava-platform-bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refinement topic: backend Backend development tickets
Projects
Development

Successfully merging a pull request may close this issue.

4 participants