From ca6b55852e811f466bafc5654c5dfc90029f5f85 Mon Sep 17 00:00:00 2001 From: Rashmik <146672184+rash-27@users.noreply.github.com> Date: Tue, 23 Apr 2024 00:22:47 +0530 Subject: [PATCH] upgrade user skills (#2096) * upgrade user skills * add custom migration --------- Co-authored-by: Vignesh Hari --- .../management/commands/load_skill_data.py | 9 ++++++ .../migrations/0016_upgrade_user_skills.py | 31 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 care/users/migrations/0016_upgrade_user_skills.py diff --git a/care/users/management/commands/load_skill_data.py b/care/users/management/commands/load_skill_data.py index 4d476f793f..3325ba448e 100644 --- a/care/users/management/commands/load_skill_data.py +++ b/care/users/management/commands/load_skill_data.py @@ -17,6 +17,7 @@ def handle(self, *args, **options): "Anesthesiologist", "Cardiac Surgeon", "Cardiologist", + "Dentist", "Dermatologist", "Diabetologist", "Emergency Medicine Physician", @@ -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", @@ -35,12 +40,14 @@ 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", @@ -48,7 +55,9 @@ def handle(self, *args, **options): "Radio technician", "Radiologist", "Rheumatologist", + "Sports Medicine Specialist", "Thoraco-Vascular Surgeon", + "Transfusion Medicine Specialist", "Urologist", ] diff --git a/care/users/migrations/0016_upgrade_user_skills.py b/care/users/migrations/0016_upgrade_user_skills.py new file mode 100644 index 0000000000..1354c7e5fc --- /dev/null +++ b/care/users/migrations/0016_upgrade_user_skills.py @@ -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), + ]