diff --git a/atlas/migrations/0089_remove_condition_primary_remove_condition_synonym.py b/atlas/migrations/0089_remove_condition_primary_remove_condition_synonym.py new file mode 100644 index 00000000..8398f0a6 --- /dev/null +++ b/atlas/migrations/0089_remove_condition_primary_remove_condition_synonym.py @@ -0,0 +1,21 @@ +# Generated by Django 5.2.7 on 2025-11-24 10:31 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('atlas', '0088_remove_finding_primary_remove_finding_synonym_and_more'), + ] + + operations = [ + migrations.RemoveField( + model_name='condition', + name='primary', + ), + migrations.RemoveField( + model_name='condition', + name='synonym', + ), + ] diff --git a/atlas/models.py b/atlas/models.py index 7ebd9427..0bd4eebd 100644 --- a/atlas/models.py +++ b/atlas/models.py @@ -231,12 +231,6 @@ class Finding(SynMixin, models.Model): class Condition(SynMixin, models.Model): name = models.CharField(max_length=255, unique=True) - - synonym = models.ManyToManyField( - "self", - blank=True, - help_text="Use if a direct synonym for the condition exists, e.g. 'Wegener granulomatosis' and 'Granulomatosis with Polyangitis'.", - ) # New canonical/alias field (Option B): if set, this Condition is an alias # and points to the canonical/master Condition. canonical = models.ForeignKey( @@ -256,10 +250,10 @@ class Condition(SynMixin, models.Model): help_text="Use if the condition could be considered a subset of another, e.g. 'Alzheimer disease' and 'Dementia'.", ) - primary = models.BooleanField( - default="True", - help_text="Sets if this should be the canonical item, all other synonyms will then redirect to this by default.", - ) + # Legacy fields `synonym` (M2M) and `primary` (boolean) have been removed. + # Canonical/aliases are represented by the `canonical` ForeignKey and + # the reverse `aliases` related_name. Use `get_synonyms()` / + # `canonical_condition` to access canonical groups. subspecialty = models.ManyToManyField( "subspecialty",