Skip to content

Commit

Permalink
upgrade user skills (#2096)
Browse files Browse the repository at this point in the history
* upgrade user skills

* add custom migration

---------

Co-authored-by: Vignesh Hari <[email protected]>
  • Loading branch information
rash-27 and vigneshhari authored Apr 22, 2024
1 parent 8b7baf5 commit ca6b558
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
9 changes: 9 additions & 0 deletions care/users/management/commands/load_skill_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def handle(self, *args, **options):
"Anesthesiologist",
"Cardiac Surgeon",
"Cardiologist",
"Dentist",
"Dermatologist",
"Diabetologist",
"Emergency Medicine Physician",
Expand All @@ -25,8 +26,12 @@ def handle(self, *args, **options):
"Gastroenterologist",
"General Medicine",
"General Surgeon",
"Geriatrician",
"Hematologist",
"Immunologist",
"Infectious Disease Specialist",
"Intensivist",
"MBBS doctor",
"Medical Officer",
"Nephrologist",
"Neuro Surgeon",
Expand All @@ -35,20 +40,24 @@ def handle(self, *args, **options):
"Oncologist",
"Oncology Surgeon",
"Ophthalmologist",
"Oral and Maxillofacial Surgeon",
"Orthopedic",
"Orthopedic Surgeon",
"Otolaryngologist (ENT)",
"Pediatrician",
"Palliative care Physician",
"Pathologist",
"Pediatric Surgeon",
"Physician",
"Plastic Surgeon",
"Psychiatrist",
"Pulmonologist",
"Radio technician",
"Radiologist",
"Rheumatologist",
"Sports Medicine Specialist",
"Thoraco-Vascular Surgeon",
"Transfusion Medicine Specialist",
"Urologist",
]

Expand Down
31 changes: 31 additions & 0 deletions care/users/migrations/0016_upgrade_user_skills.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Generated by Django 4.2.10 on 2024-04-18 05:42

from django.db import migrations


def add_skills(apps, schema_editor):
Skill = apps.get_model("users", "Skill")
if Skill.objects.exists():
skills = [
"Dentist",
"Geriatrician",
"Immunologist",
"Infectious Disease Specialist",
"MBBS doctor",
"Oral and Maxillofacial Surgeon",
"Pediatric Surgeon",
"Sports Medicine Specialist",
"Transfusion Medicine Specialist",
]
for skill in skills:
Skill.objects.get_or_create(name=skill)


class Migration(migrations.Migration):
dependencies = [
("users", "0015_age_to_dateofbirth"),
]

operations = [
migrations.RunPython(add_skills),
]

0 comments on commit ca6b558

Please sign in to comment.