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
@@ -5,7 +5,7 @@ from __future__ import unicode_literals
from django.db import migrations, models
def make_labels_unique(apps, schema_editor):
def operation_make_labels_unique(apps, schema_editor):
Source = apps.get_model('sources', 'Source')
for source in Source.objects.using(schema_editor.connection.alias).all():
@@ -18,7 +18,7 @@ def make_labels_unique(apps, schema_editor):
source.save()
def make_labels_unique_reverse(apps, schema_editor):
def operation_make_labels_unique_reverse(apps, schema_editor):
Source = apps.get_model('sources', 'Source')
for source in Source.objects.using(schema_editor.connection.alias).all():
@@ -35,7 +35,7 @@ class Migration(migrations.Migration):
operations = [
migrations.RunPython(
make_labels_unique, reverse_code=make_labels_unique_reverse
code=operation_make_labels_unique, reverse_code=operation_make_labels_unique_reverse
),
migrations.AlterField(
model_name='source',