From 47bec7704b734ec61d8a35bb250c9929cb7bdc87 Mon Sep 17 00:00:00 2001 From: Bavisetti Narayan <72156168+NarayanBavisetti@users.noreply.github.com> Date: Wed, 13 Sep 2023 12:06:38 +0530 Subject: [PATCH] chore: priority migration (#2162) --- .../db/migrations/0043_auto_20230912_1733.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 apiserver/plane/db/migrations/0043_auto_20230912_1733.py diff --git a/apiserver/plane/db/migrations/0043_auto_20230912_1733.py b/apiserver/plane/db/migrations/0043_auto_20230912_1733.py new file mode 100644 index 000000000..e0602dc93 --- /dev/null +++ b/apiserver/plane/db/migrations/0043_auto_20230912_1733.py @@ -0,0 +1,24 @@ +# Generated by Django 4.2.3 on 2023-09-12 17:33 + +from django.db import migrations + + +def update_issue_priority_choice(apps, schema_editor): + IssueModel = apps.get_model("db", "Issue") + updated_issues = [] + for obj in IssueModel.objects.all(): + if obj.priority is None: + obj.priority = "none" + updated_issues.append(obj) + IssueModel.objects.bulk_update(updated_issues, ["priority"], batch_size=100) + + +class Migration(migrations.Migration): + + dependencies = [ + ('db', '0042_alter_analyticview_created_by_and_more'), + ] + + operations = [ + migrations.RunPython(update_issue_priority_choice), + ]