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

ICF CPHEAPM 60: schema change and migration #1087

Closed
wants to merge 9 commits into from

Conversation

ZindahFarhaICF
Copy link
Collaborator

@ZindahFarhaICF ZindahFarhaICF commented Aug 26, 2024

  • 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"
),
Copy link
Collaborator Author

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 = []
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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?

@shapiromatron
Copy link
Owner

@ZindahFarhaICF sorry I didn't mean to merge main into this branch; feel free to continue; I hope this didn't cause any issues

@ZindahFarhaICF ZindahFarhaICF marked this pull request as ready for review September 13, 2024 18:56
@ZindahFarhaICF ZindahFarhaICF changed the title Feat: initial task management schema change and migration ICF CPHEAPM 60: schema change and migration Sep 13, 2024
@shapiromatron shapiromatron self-assigned this Sep 28, 2024
# Conflicts:
#	hawc/apps/mgmt/forms.py
#	tests/hawc/apps/mgmt/test_views.py
@shapiromatron
Copy link
Owner

Closing; will review from the larger #1112 since code in this PR was edited

@shapiromatron shapiromatron deleted the ICF-cpheapm60-migrate-schema branch January 22, 2025 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants