Style: Prepend "operation_" to data migrations

Prepend "operation_" to the data migration functions
for clear purpose. Add keyword arguments to the RunPython
migration opration.

Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2018-12-07 17:28:22 -04:00
parent ab1482152e
commit 255b1c75ea
11 changed files with 29 additions and 29 deletions
@@ -4,7 +4,7 @@ from __future__ import unicode_literals
from django.db import migrations
def move_content_from_documents_to_ocr_app(apps, schema_editor):
def operation_move_content_from_documents_to_ocr_app(apps, schema_editor):
DocumentPage = apps.get_model('documents', 'DocumentPage')
DocumentPageContent = apps.get_model('ocr', 'DocumentPageContent')
@@ -22,5 +22,5 @@ class Migration(migrations.Migration):
]
operations = [
migrations.RunPython(move_content_from_documents_to_ocr_app),
migrations.RunPython(code=operation_move_content_from_documents_to_ocr_app),
]
@@ -4,7 +4,7 @@ from __future__ import unicode_literals
from django.db import models, migrations
def create_ocr_setting_for_existing_document_types(apps, schema_editor):
def operation_create_ocr_setting_for_existing_document_types(apps, schema_editor):
DocumentType = apps.get_model('documents', 'DocumentType')
DocumentTypeSettings = apps.get_model('ocr', 'DocumentTypeSettings')
@@ -55,5 +55,5 @@ class Migration(migrations.Migration):
},
bases=(models.Model,),
),
migrations.RunPython(create_ocr_setting_for_existing_document_types),
migrations.RunPython(code=operation_create_ocr_setting_for_existing_document_types),
]