Merge pull request #33885 from openedx/dkaplan1/APER-2942_remove-the-external-id-type
feat: remove the micro bachelors coaching external ID type
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
# Generated by Django 3.2.23 on 2023-12-05 16:22
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("external_user_ids", "0007_remove_mbcoaching_extids"),
|
||||
]
|
||||
|
||||
coaching_name = "mb_coaching"
|
||||
|
||||
def create_mb_coaching_type(apps, schema_editor):
|
||||
"""
|
||||
Add a MicroBachelors (MB) coaching type
|
||||
"""
|
||||
ExternalIdType = apps.get_model("external_user_ids", "ExternalIdType")
|
||||
ExternalIdType.objects.update_or_create(
|
||||
name=Migration.coaching_name, description="MicroBachelors Coaching"
|
||||
)
|
||||
|
||||
def delete_mb_coaching_type(apps, schema_editor):
|
||||
"""
|
||||
Delete the MicroBachelors (MB) coaching type
|
||||
"""
|
||||
ExternalIdType = apps.get_model("external_user_ids", "ExternalIdType")
|
||||
ExternalIdType.objects.filter(name=Migration.coaching_name).delete()
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(
|
||||
delete_mb_coaching_type, reverse_code=create_mb_coaching_type
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user