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 #2123] Add Opportunity Attachment and Lookup Tables #2483

Merged
merged 8 commits into from
Oct 17, 2024

Conversation

mikehgrantsgov
Copy link
Collaborator

@mikehgrantsgov mikehgrantsgov commented Oct 16, 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

Screenshot 2024-10-16 at 9 53 59 AM Screenshot 2024-10-16 at 9 53 47 AM Screenshot 2024-10-16 at 9 55 06 AM

api/src/db/models/opportunity_models.py Outdated Show resolved Hide resolved
api/src/db/models/opportunity_models.py Outdated Show resolved Hide resolved
@mikehgrantsgov mikehgrantsgov changed the title Add Opportunity Attachment and Lookup Tables [Issue #2123] Add Opportunity Attachment and Lookup Tables Oct 16, 2024
Comment on lines 401 to 403
opportunity_id: Mapped[int] = mapped_column(
BigInteger, ForeignKey(Opportunity.opportunity_id), primary_key=True, index=True
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Missed this the first time, we don't need opportunity ID to be a part of the primary key here I don't think.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, makes sense. Made that change.

Copy link
Collaborator

@chouinar chouinar left a comment

Choose a reason for hiding this comment

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

LGTM!

@mikehgrantsgov mikehgrantsgov merged commit 1053f0b into main Oct 17, 2024
8 checks passed
@mikehgrantsgov mikehgrantsgov deleted the mikehgrantsgov/2123-add-attachment-tables branch October 17, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create tables for opportunity attachments
4 participants