-
Notifications
You must be signed in to change notification settings - Fork 16
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
ICF CPHEAPM 60: schema change and migration #1087
Conversation
ZindahFarhaICF
commented
Aug 26, 2024
•
edited
Loading
edited
- Write new database schema and migrate existing data to this new schema. Enable CRUD only through django admin.
- Re-enable current triggers (https://hawc.readthedocs.io/project-management/) using the new TaskTrigger method instead of the current methods in signals.
- Re-enable current mgmt task list/edit views.
"assessment", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, to="assessment.assessment" | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the TaskTrigger "assessment" field for clarity/ease when developing; functionally, the program will work without it if preferred, as task types and statuses are assessment-specific.
|
||
# create all possible types/statuses for each assessment | ||
status_instances = [] | ||
type_instances = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that we want users to specify tasks/statuses on assessment creation, so I created entries for all possible items per assessment. Creating only the statuses currently used in the Tasks table would lead to handling missing statuses when assigning triggers in the next migration
""" | ||
Create task triggers for an assessment and save to database. This | ||
should eventually take user-defined input, but currently creates all | ||
possible defined triggers for managed assessments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is a bit convoluted, but I anticipate changing it soon / in the next PR. Users are not able to add triggers on assessment creation yet, so the existing constants are used in ensuring triggers exist for new assessments. Thoughts on handling this?
@ZindahFarhaICF sorry I didn't mean to merge main into this branch; feel free to continue; I hope this didn't cause any issues |
…to ICF-cpheapm60-migrate-schema
# Conflicts: # hawc/apps/mgmt/forms.py # tests/hawc/apps/mgmt/test_views.py
Closing; will review from the larger #1112 since code in this PR was edited |