-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* upgrade user skills * add custom migration --------- Co-authored-by: Vignesh Hari <[email protected]>
- Loading branch information
1 parent
8b7baf5
commit ca6b558
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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), | ||
] |