mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-01-14 21:54:22 -06:00
Use id ordering
This commit is contained in:
@@ -2,13 +2,12 @@
|
||||
|
||||
from django.db import migrations
|
||||
from django.db import models
|
||||
from django.db.models import F
|
||||
|
||||
|
||||
def populate_action_order(apps, schema_editor):
|
||||
WorkflowAction = apps.get_model("documents", "WorkflowAction")
|
||||
for index, action in enumerate(WorkflowAction.objects.all()):
|
||||
action.order = index
|
||||
action.save()
|
||||
WorkflowAction.objects.all().update(order=F("id"))
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
Reference in New Issue
Block a user