From 39751b3a49a51919d9d5d0758b65a7461de5163b Mon Sep 17 00:00:00 2001 From: Gagan Deep Date: Thu, 16 Jan 2025 20:25:44 +0530 Subject: [PATCH] [fix] Wrap measurement name in double quotes in timeseries_migrate command Bug: The READ_QUERY was failing if the measurement name starts with an integer. --- .../migrations/influxdb/influxdb_alter_structure_0006.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openwisp_monitoring/monitoring/migrations/influxdb/influxdb_alter_structure_0006.py b/openwisp_monitoring/monitoring/migrations/influxdb/influxdb_alter_structure_0006.py index 1ec5aee1..60e55984 100644 --- a/openwisp_monitoring/monitoring/migrations/influxdb/influxdb_alter_structure_0006.py +++ b/openwisp_monitoring/monitoring/migrations/influxdb/influxdb_alter_structure_0006.py @@ -12,12 +12,12 @@ SELECT_QUERY_LIMIT = 1000 WRITE_BATCH_SIZE = 1000 READ_QUERY = ( - "SELECT {fields} FROM {measurement}" + "SELECT {fields} FROM \"{measurement}\"" " WHERE content_type='{content_type_key}'" " AND object_id='{object_id}'" ) DELETE_QUERY = ( - "DROP SERIES FROM {old_measurement}" + "DROP SERIES FROM \"{old_measurement}\"" " WHERE content_type='{content_type_key}'" " AND object_id='{object_id}'" )