Skip to content

Create Through table for SubjectGroup and Subject table for Many to Many relationship #89

@seg1129

Description

@seg1129

Issue
There is a potential for database integrity error when deleting subjects. because of the Django upgrade Django will no longer allow cascading delete on many to many fields. So when a subject is deleted, they could also be referenced in the subject group table.

Permanent Fix
There is a many to many relationship between Subject group and Subjects, here is the model. we need to create a through table and specify to cascade delete. How to create Django through tables can be found here

Temporary process to delete subjects
Get the following information

  • Ehb subject primary key
  • Ehb Protocol subject group primary key
    • NOTE: not the BRP protocol ID
  • Get the unique Group name for subject in the protocol

Steps to Delete

  1. Delete subject from subject group
    • API call documentation can be found here
  2. Add ‘BAD:’ to beginning of unique group name for subject in the protocol
    • Can be done through the eHB UI
  3. Delete subject from eHB subject table
    • Can be done through the eHB UI

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions