From b1cfc496b2e8d47eb8e12fb2462a93109f912eaa Mon Sep 17 00:00:00 2001 From: Pippo Raimondi Date: Thu, 12 Oct 2023 16:51:59 +0100 Subject: [PATCH] Remove not specified FDI --- .../0026_remove_FDI_not_specified.py | 20 +++++++++++++++++++ app/enquiries/ref_data.py | 1 - 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 app/enquiries/migrations/0026_remove_FDI_not_specified.py diff --git a/app/enquiries/migrations/0026_remove_FDI_not_specified.py b/app/enquiries/migrations/0026_remove_FDI_not_specified.py new file mode 100644 index 00000000..094b2fd7 --- /dev/null +++ b/app/enquiries/migrations/0026_remove_FDI_not_specified.py @@ -0,0 +1,20 @@ +from django.db import migrations, models + +def set_not_specified_to_default(apps, schema_editor): + Enquiry = apps.get_model('enquiries', 'Enquiry') + Enquiry.objects.filter(investment_type='NOT_SPECIFIED').update(investment_type='DEFAULT') + +class Migration(migrations.Migration): + + dependencies = [ + ('enquiries', '0025_auto_20230622_1559'), + ] + + operations = [ + migrations.RunPython(set_not_specified_to_default, reverse_code=migrations.RunPython.noop), + migrations.AlterField( + model_name='enquiry', + name='investment_type', + field=models.CharField(choices=[('DEFAULT', '----'), ('ACQUISITION', 'Acquisition'), ('CAPITAL_ONLY', 'Capital only'), ('NEW_SITE', 'Creation of new site or activity'), ('EXPANSION', 'Expansion of existing site or activity'), ('JOINT_VENTURE', 'Joint venture'), ('MERGER', 'Merger'), ('RETENTION', 'Retention')], default='DEFAULT', max_length=255, verbose_name='Investment type'), + ), + ] diff --git a/app/enquiries/ref_data.py b/app/enquiries/ref_data.py index 013c2fae..455a3f92 100644 --- a/app/enquiries/ref_data.py +++ b/app/enquiries/ref_data.py @@ -380,7 +380,6 @@ class InvestmentType(models.TextChoices): JOINT_VENTURE = "JOINT_VENTURE", _("Joint venture") MERGER = "MERGER", _("Merger") RETENTION = "RETENTION", _("Retention") - NOT_SPECIFIED = "NOT_SPECIFIED", _("Not specified") class NewExistingInvestor(models.TextChoices):