diff --git a/src/documents/management/commands/convert_mariadb_uuid.py b/src/documents/management/commands/convert_mariadb_uuid.py index 4000e67cb..86c093700 100644 --- a/src/documents/management/commands/convert_mariadb_uuid.py +++ b/src/documents/management/commands/convert_mariadb_uuid.py @@ -1,6 +1,7 @@ from django.core.management.base import BaseCommand from django.db import connection from django.db import models +from django.db import transaction from documents.models import Document @@ -33,4 +34,5 @@ class Command(BaseCommand): ) def handle(self, **options): - self.convert_field(Document, "transaction_id", null=True) + with transaction.atomic(): + self.convert_field(Document, "transaction_id", null=True)