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_program_area_xref #45

Open
15 of 16 tasks
Neecolaa opened this issue Sep 4, 2022 · 6 comments · May be fixed by #431
Open
15 of 16 tasks

Create Table: project_program_area_xref #45

Neecolaa opened this issue Sep 4, 2022 · 6 comments · May be fixed by #431
Assignees
Labels
complexity: small All steps are laid out in detail so that someone new to the project can work on it feature: table creation p-feature: program area all projects have a program area. the CoPs's program area is CoP ready for dev lead role: back end s: hackforla.org stakeholder: hackforla.org website s: org stakeholder: the org (includes stats) size: 2pt Can be done in 7-12 hours

Comments

@Neecolaa
Copy link
Member

Neecolaa commented Sep 4, 2022

Overview

We need to create the project_program_area_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

  • add issue link to the tables tab of the spreadsheet
  • identify and document table description (see spreadsheet under Resources)
  • 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)
    • Review and correct discrepancies
  • 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)
  • 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

Resources/Instructions

Description

Join table: links project to program area

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 program area
    • (FK) program_area_id - int - id of program area linked to project
    • created - timestamp
  2. In ERD only (having items here indicates a mismatch, which requires a review)

    • created_date - timestamp

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)

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

    • None
@Neecolaa Neecolaa mentioned this issue Sep 4, 2022
39 tasks
@fyliu fyliu added this to the All tables added milestone Sep 25, 2022
@ExperimentsInHonesty ExperimentsInHonesty added p-feature: program area all projects have a program area. the CoPs's program area is CoP stakeholder: missing labels Mar 5, 2023
@ExperimentsInHonesty ExperimentsInHonesty added s: hackforla.org stakeholder: hackforla.org website s: org stakeholder: the org (includes stats) and removed stakeholder: missing labels Apr 7, 2023
@shmonks shmonks moved this to Prioritized Backlog in P: PD: Project Board Jun 7, 2024
@fyliu fyliu added complexity: small All steps are laid out in detail so that someone new to the project can work on it and removed complexity: missing labels Jun 24, 2024
@del9ra del9ra self-assigned this Aug 28, 2024
@del9ra del9ra moved this from Prioritized Backlog to In progress (actively working) in P: PD: Project Board Aug 28, 2024
@del9ra
Copy link
Member

del9ra commented Aug 28, 2024

ETA: September 1, 6 PM
Availability: Mon-Fri 10AM-15PM

@shmonks shmonks moved this from 🏗In progress (actively working) to ❓Questions/Review in P: PD: Project Board Sep 20, 2024
@shmonks
Copy link
Member

shmonks commented Sep 20, 2024

Most xref tables can created automatically by Django, so this issue needs to be rewritten to define the many to many relationship.

@fyliu
Copy link
Member

fyliu commented Oct 10, 2024

After slack messaging with @del9ra, we realized that probably none of the xref tables can use the "through" table generated by Django, because the generated table won't contain the created_at and updated_at fields defined in the abstract base class. So in that case, we should discuss @del9ra's suggestion to create another abstract base class to add a standardized ended_at field to all the xref table models that inherit from it.

In any case, that means this issue does still need to implement a new model.

@del9ra
Copy link
Member

del9ra commented Oct 10, 2024

After slack messaging with @del9ra, we realized that probably none of the xref tables can use the "through" table generated by Django, because the generated table won't contain the created_at and updated_at fields defined in the abstract base class. So in that case, we should discuss @del9ra's suggestion to create another abstract base class to add a standardized ended_at field to all the xref table models that inherit from it.

Variations of ended are used not only in xref models but also in other models: ended_at in the Affiliation model, ended in the Permission model, project_sponsor_partner_xref, and permission_history, and ended_on in project_language_xref and project_sdg_xref.

In any case, that means this issue does still need to implement a new model.

@fyliu I didn't implement a new model in my new PR #398 ; I just added a program_areas many-to-many field in the Project model.

@fyliu
Copy link
Member

fyliu commented Oct 18, 2024

I think we need to discuss with @Neecolaa on using the same name and type for the xref table to mark when the relationship ended. Adding "ready for DB Architect" and will add an item to the next meeting.

@del9ra I think we do need to add the xref model just because the created timestamp is a requirement and that model would provide it. I would wait for @dmartin4820's PR #385 to be merged and use that as a model for this issue.

@del9ra
Copy link
Member

del9ra commented Oct 21, 2024

@fyliu #376 (comment) Here you said:

"...this xref table doesn't have any extra data fields other than the relations (foreign keys). It means that we don't really need to create a Django model for this table at all.."

@del9ra del9ra linked a pull request Nov 7, 2024 that will close this issue
@del9ra del9ra self-assigned this Nov 13, 2024
@shmonks shmonks moved this from ❓Questions/Review to 🏗In progress-actively working in P: PD: Project Board Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity: small All steps are laid out in detail so that someone new to the project can work on it feature: table creation p-feature: program area all projects have a program area. the CoPs's program area is CoP ready for dev lead role: back end s: hackforla.org stakeholder: hackforla.org website s: org stakeholder: the org (includes stats) size: 2pt Can be done in 7-12 hours
Projects
Status: 🏗In progress-actively working
5 participants