hackforla / hackforla/peopledepot
Update Table: user (replace role association with practice area)
- Dominant language
- Python
- Stars
- 14
- Forks
- 37
- Avg merge
- 9d 15h
- Merged PRs (30d)
- 5
Description
### Dependency
- [ ] https://github.com/hackforla/peopledepot/issues/432#issuecomment-2617039378 - this dependency should be replaced by the epic issue # when it's made
### Overview
We need to update the user table model to utilize the practice area table instead of the outdated role table.
#### Details
- The initial model issue is #15
Discussion leading to this change is here: https://github.com/hackforla/peopledepot/discussions/170
### Action Items
- [x] Update schema information
- [x] add/remove given columns from [Entity Relationship Diagram (ERD)](https://lucid.app/lucidchart/ac2f3e81-00d2-4257-b1fc-266d7f0a4cbe/view)
- [x] add/remove given columns from [PD: Table and Field definitions](https://docs.google.com/spreadsheets/d/1x_zZ8JLS2hO-zG0jUocOJmX16jh-DF5dccrd_OEGNZ0/edit#gid=1572339087)
- [x] make additional schema changes (if needed)
- [x] remove the ERD/SS update label after these changes are made.
- Permission is needed to edit the ERD and table spreadsheet.
- [ ] Update existing Django model
- [ ] Uncomment the `created_by` and `updated_by` ForeignKey fields in the `Permission` model after this dependency is completed.
- [ ] Write a test for the new relationships this model will have with other models (e.g., creating a user and assigning them a set of permissions on a project) if any.
- [ ] Update API end point
- [ ] Update API unit tests
- [ ] Document the endpoint in Swagger
### Changes Needed
#### Columns to Remove
- [x] desired_roles - varchar
- [x] practice_area_current - int (practice_area_id)
#### Columns to Add
- [ ] practice_area_primary - FK int (practice_area_id) - see #63
- [ ] practice_areas_secondary - FK int (practice_area_id) - see #63
#### Additional Changes
- [x] Remove relationship between user and role tables (table spreadsheet & ERD)
- [x] Add relationship between user and practice_area (table spreadsheet & ERD)
### Resources
- See [People Depot Resources wiki page](https://github.com/hackforla/peopledepot/wiki/Resources-and-Links) for links
- ERD
- Spreadsheet: [PD: Table and field explanations, Current Field Permission tab](https://docs.google.com/spreadsheets/d/1x_zZ8JLS2hO-zG0jUocOJmX16jh-DF5dccrd_OEGNZ0/edit?gid=749942651)
- API Endpoint
- [Commented `created_by` and `updated_by` fields in `Permission`](https://github.com/amdbouka/peopledepot/blob/845d5476b58ffd51826d5673c5808201a5091ad9/app/core/models.py#L429-L440)
Contributor guide
Assessment
This issue has not been assessed yet.