From b8bf8af2c58c6e35159a070948527748c76aaea5 Mon Sep 17 00:00:00 2001 From: Deborah Kaplan Date: Tue, 5 Dec 2023 16:32:36 +0000 Subject: [PATCH] feat: remove the micro bachelors coaching external ID type These ids have all been removed, the code that used them as long deprecated, and they were only ever used within products currently within the purview of 2U. FIXES: APER-2942 --- .../0008_remove_mbcoaching_extid_type.py | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 openedx/core/djangoapps/external_user_ids/migrations/0008_remove_mbcoaching_extid_type.py diff --git a/openedx/core/djangoapps/external_user_ids/migrations/0008_remove_mbcoaching_extid_type.py b/openedx/core/djangoapps/external_user_ids/migrations/0008_remove_mbcoaching_extid_type.py new file mode 100644 index 0000000000..f04ae01cbe --- /dev/null +++ b/openedx/core/djangoapps/external_user_ids/migrations/0008_remove_mbcoaching_extid_type.py @@ -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 + ), + ]