hackforla / peopledepot

A project to setup a datastore for people and projects at HackforLA. The link below takes you to the code documentation
https://hackforla.github.io/peopledepot/
GNU General Public License v2.0
7 stars 26 forks source link

Create Table: project_program_area_xref #45

Open Neecolaa opened 2 years ago

Neecolaa commented 2 years ago

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

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)

    • [x] (PK) id - int - Record Id
    • [x] (FK) project_id - int - id of project linked to program area
    • [x] (FK) program_area_id - int - id of program area linked to project
    • [x] 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)

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

    • None
del9ra commented 2 months ago

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

shmonks commented 1 month ago

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

fyliu commented 3 weeks ago

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 commented 3 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

@fyliu https://github.com/hackforla/peopledepot/pull/376#discussion_r1749162686 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.."