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 Table: project_sponsor_partner_xref #65

Closed
18 of 22 tasks
ericvennemeyer opened this issue Sep 9, 2022 · 12 comments · Fixed by #270
Closed
18 of 22 tasks

Create Table: project_sponsor_partner_xref #65

ericvennemeyer opened this issue Sep 9, 2022 · 12 comments · Fixed by #270
Assignees
Labels
complexity: missing feature: table creation p-feature: projects project and projects PII: FALSE Table or function does not have or use Personally Identifiable Information (PII) role: back end s: hackforla.org stakeholder: hackforla.org website s: org stakeholder: the org (includes stats) s: VRMS stakeholder: VRMS size: 2pt Can be done in 7-12 hours

Comments

@ericvennemeyer
Copy link
Member

ericvennemeyer commented Sep 9, 2022

Overview

We need to create the project_sponsor_partner_xref table so that we can update a shared data store across hackforla.org, vrms, civictechjobs, and tables (onboarding) project.

Details

A table and a model are the same thing

Action Items

  • identify and document table description (see spreadsheet under Resources)
    • if not, reach out to PD leads
  • compare and check off the data fields (below) against the ERD. Note any fields in the ERD that's missing from the list. (see Resources)
  • compare the check off associated tables (below) against the ERD. Note any associated tables in the ERD that's missing from the list (see Resources)
  • create a single model in Django (defining schema)
    • add the docstring from the section below
  • write a test for the relationships this model will have with other models (e.g., creating a user and assigning them a set of permissions on a project).
  • write an API end point
  • write API unit tests
  • document the endpoint

After Merge

Resources/Instructions

Sponsor/Partner clarification

Sponsor/partner relationships stored in this table are project-dependent. They cannot be both a sponsor and a partner for the same project, so if is_sponsor is FALSE they are a project partner, if is_sponsor is TRUE they are a project sponsor.

Description

Stores the relationship between sponsors/partners and projects (Joins tables sponsor_partner and project)

Table name vs Model name

  • The table name should be project_affiliate_xref, but the Django model name should be Affiliation for ease of coding.
    • Use db_table field in meta to specify the db table name

Data Fields

  1. Copied from spreadsheet and checked off according to ERD. (unchecked items indicate a mismatch between ERD and spreadsheet, which requires a review)

    • (PK) id - int - Record Id
    • (FK) project_id - int - id of project linked to partner
    • (FK) partner_id - int - id of partner linked to project
    • created - timestamp
    • ended - timestamp
    • is_sponsor - boolean
    • is_partner - boolean
  2. In ERD only (having items here indicates a mismatch, which requires a review)

    • None

Associated Tables

  1. Copied from spreadsheet and checked off according to ERD. (unchecked items indicate a mismatch between ERD and spreadsheet, which requires a review)

    • project (many-to-one)
    • sponsor_partner (many-to-one)
  2. In ERD only (having items here indicates a mismatch, which requires a review)

    • None
@fyliu fyliu added good first issue Good for newcomers and removed good first issue Good for newcomers labels Sep 20, 2022
@fyliu fyliu added this to the All tables added milestone Sep 25, 2022
@ExperimentsInHonesty ExperimentsInHonesty added p-feature: projects project and projects stakeholder: missing s: VRMS stakeholder: VRMS s: hackforla.org stakeholder: hackforla.org website s: org stakeholder: the org (includes stats) and removed stakeholder: missing labels Mar 5, 2023
@ExperimentsInHonesty ExperimentsInHonesty added the PII: FALSE Table or function does not have or use Personally Identifiable Information (PII) label May 4, 2023
@Neecolaa Neecolaa added the feature: ERD/SS adjustment Requires adjustments to be made to the ERD & Spreadsheet label May 21, 2023
@Neecolaa

This comment was marked as resolved.

@fyliu

This comment was marked as resolved.

@Neecolaa

This comment was marked as resolved.

@Neecolaa

This comment was marked as resolved.

@ExperimentsInHonesty

This comment was marked as resolved.

@ExperimentsInHonesty ExperimentsInHonesty added role: back end and removed feature: ERD/SS adjustment Requires adjustments to be made to the ERD & Spreadsheet role: db architect labels Aug 11, 2023
@fyliu

This comment was marked as off-topic.

@fyliu

This comment was marked as off-topic.

@Neecolaa Neecolaa changed the title Create Table: project_partner_xref Create Table: project_sponsor_partner_xref Sep 25, 2023
@Neecolaa

This comment was marked as resolved.

@freaky4wrld freaky4wrld self-assigned this Mar 1, 2024
@freaky4wrld
Copy link
Member

freaky4wrld commented Mar 1, 2024

@fyliu there's an action item, to add the doc-string, can you point out the section from which it is to be copied.
Also just clarifying in the schema shall I add the created_date and ended field, or leave the created_date as it is inherited from the AbstractBaseModel.

Thanks !!

@fyliu
Copy link
Member

fyliu commented Mar 1, 2024

@freaky4wrld I think it's the clarification section.

@fyliu
Copy link
Member

fyliu commented Mar 22, 2024

@Neecolaa I brought up converting the boolean is_partner into an enum or choice. Here's the django documentation on that. It'd be a char field in the database.

To add choices, we'd have to modify the code. It shouldn't need to modify the database, since it'd still be a char field. However, it's not something that could be added on the fly like stack_element_type.

@Neecolaa

This comment was marked as resolved.

@Neecolaa Neecolaa added feature: ERD/SS adjustment Requires adjustments to be made to the ERD & Spreadsheet and removed feature: ERD/SS adjustment Requires adjustments to be made to the ERD & Spreadsheet labels May 3, 2024
@shmonks shmonks moved this to Done in P: PD: Project Board Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity: missing feature: table creation p-feature: projects project and projects PII: FALSE Table or function does not have or use Personally Identifiable Information (PII) role: back end s: hackforla.org stakeholder: hackforla.org website s: org stakeholder: the org (includes stats) s: VRMS stakeholder: VRMS size: 2pt Can be done in 7-12 hours
Projects
Status: ✅Done
Development

Successfully merging a pull request may close this issue.

5 participants