diff --git a/openwisp_monitoring/monitoring/migrations/0013_metric_configuration.py b/openwisp_monitoring/monitoring/migrations/0016_metric_configuration.py similarity index 91% rename from openwisp_monitoring/monitoring/migrations/0013_metric_configuration.py rename to openwisp_monitoring/monitoring/migrations/0016_metric_configuration.py index 1d858ff3e..021f975ad 100644 --- a/openwisp_monitoring/monitoring/migrations/0013_metric_configuration.py +++ b/openwisp_monitoring/monitoring/migrations/0016_metric_configuration.py @@ -7,7 +7,7 @@ class Migration(migrations.Migration): dependencies = [ - ('monitoring', '0012_rename_graph_chart'), + ('monitoring', '0015_delete_models'), ] operations = [ diff --git a/openwisp_monitoring/monitoring/migrations/0014_merge_traffic_metrics_and_fill_metric_config.py b/openwisp_monitoring/monitoring/migrations/0017_merge_traffic_metrics_and_fill_metric_config.py similarity index 97% rename from openwisp_monitoring/monitoring/migrations/0014_merge_traffic_metrics_and_fill_metric_config.py rename to openwisp_monitoring/monitoring/migrations/0017_merge_traffic_metrics_and_fill_metric_config.py index 255b1ba57..750c6d0d1 100644 --- a/openwisp_monitoring/monitoring/migrations/0014_merge_traffic_metrics_and_fill_metric_config.py +++ b/openwisp_monitoring/monitoring/migrations/0017_merge_traffic_metrics_and_fill_metric_config.py @@ -51,7 +51,7 @@ def fill_configuration(apps, schema_editor): class Migration(migrations.Migration): dependencies = [ - ('monitoring', '0013_metric_configuration'), + ('monitoring', '0016_metric_configuration'), ] operations = [ diff --git a/tests/openwisp2/sample_monitoring/migrations/0001_initial.py b/tests/openwisp2/sample_monitoring/migrations/0001_initial.py index ef31cecf1..f575408c7 100644 --- a/tests/openwisp2/sample_monitoring/migrations/0001_initial.py +++ b/tests/openwisp2/sample_monitoring/migrations/0001_initial.py @@ -9,6 +9,7 @@ import swapper from openwisp_monitoring.monitoring.charts import CHART_CONFIGURATION_CHOICES +from openwisp_monitoring.monitoring.metrics import get_metric_configuration_choices class Migration(migrations.Migration): @@ -49,7 +50,14 @@ class Migration(migrations.Migration): ), ), ('name', models.CharField(max_length=64)), - ('description', models.TextField(blank=True)), + ( + 'configuration', + models.CharField( + choices=get_metric_configuration_choices(), + max_length=16, + null=True, + ), + ), ( 'key', models.SlugField( diff --git a/tests/openwisp2/sample_monitoring/migrations/0006_metric_configuration.py b/tests/openwisp2/sample_monitoring/migrations/0006_metric_configuration.py deleted file mode 100644 index 3d2d8030f..000000000 --- a/tests/openwisp2/sample_monitoring/migrations/0006_metric_configuration.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.0.3 on 2020-05-29 02:12 - -from django.db import migrations, models -from openwisp_monitoring.monitoring.metrics import get_metric_configuration_choices - - -class Migration(migrations.Migration): - - dependencies = [ - ('sample_monitoring', '0005_rename_graph_chart'), - ] - - operations = [ - migrations.AddField( - model_name='metric', - name='configuration', - field=models.CharField( - choices=get_metric_configuration_choices(), max_length=16, null=True, - ), - ), - migrations.RemoveField(model_name='metric', name='description'), - ]