From 27ed68923579c5afff0c70b025deb8b73d448aa8 Mon Sep 17 00:00:00 2001 From: Jeferson Moura Date: Wed, 18 Jul 2018 12:38:06 +0200 Subject: [PATCH] Set calculation type of all indicators to Number --- ...013_set_all_calculation_type_to_numeric.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 indicators/migrations/0013_set_all_calculation_type_to_numeric.py diff --git a/indicators/migrations/0013_set_all_calculation_type_to_numeric.py b/indicators/migrations/0013_set_all_calculation_type_to_numeric.py new file mode 100644 index 000000000..492906a43 --- /dev/null +++ b/indicators/migrations/0013_set_all_calculation_type_to_numeric.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.3 on 2018-07-04 09:56 +from __future__ import unicode_literals + +from django.db import migrations +from ..models import Indicator + + +def set_calculation_type(apps, schema_editor): + Indicator.objects.all().update( + calculation_type=Indicator.CALC_TYPE_NUMERIC) + + +class Migration(migrations.Migration): + + dependencies = [ + ('indicators', '0012_auto_20180704_0256'), + ] + + operations = [ + migrations.RunPython(set_calculation_type), + ]