mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
chore: priority migration
This commit is contained in:
parent
3a2a329000
commit
170f0da3c2
24
apiserver/plane/db/migrations/0043_auto_20230912_1733.py
Normal file
24
apiserver/plane/db/migrations/0043_auto_20230912_1733.py
Normal file
@ -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),
|
||||||
|
]
|
Loading…
Reference in New Issue
Block a user