From 1cebe001a70110b9420fcba4f25eeba27666ba35 Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Thu, 31 Oct 2024 23:50:09 +0100 Subject: [PATCH 1/3] added a migration --- db/knex_migrations/2024-10-31-0000-fix-snmp-monitor.js | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 db/knex_migrations/2024-10-31-0000-fix-snmp-monitor.js diff --git a/db/knex_migrations/2024-10-31-0000-fix-snmp-monitor.js b/db/knex_migrations/2024-10-31-0000-fix-snmp-monitor.js new file mode 100644 index 0000000000..bbd8ab859d --- /dev/null +++ b/db/knex_migrations/2024-10-31-0000-fix-snmp-monitor.js @@ -0,0 +1,4 @@ +exports.up = function (knex) { + return knex('monitor').whereNull('json_path_operator').update('json_path_operator', '=='); +}; +exports.down = function (knex) {}; From b5d2aa308eafdc8fe9a7ead6b9f15b1d46d37baf Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Fri, 1 Nov 2024 00:55:57 +0100 Subject: [PATCH 2/3] added an explanation why reverting is not possible --- db/knex_migrations/2024-10-31-0000-fix-snmp-monitor.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/db/knex_migrations/2024-10-31-0000-fix-snmp-monitor.js b/db/knex_migrations/2024-10-31-0000-fix-snmp-monitor.js index bbd8ab859d..94a3ac680a 100644 --- a/db/knex_migrations/2024-10-31-0000-fix-snmp-monitor.js +++ b/db/knex_migrations/2024-10-31-0000-fix-snmp-monitor.js @@ -1,4 +1,7 @@ exports.up = function (knex) { return knex('monitor').whereNull('json_path_operator').update('json_path_operator', '=='); }; -exports.down = function (knex) {}; +exports.down = function (knex) { + // changing the json_path_operator back to null for all '==' is not possible anymore + // we have lost the context which fields have been set explicitely in >= v2.0 and which would need to be reverted +}; From d5481d0453d928583cb57c0e6779fdfb1d15e5ff Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Fri, 1 Nov 2024 00:57:58 +0100 Subject: [PATCH 3/3] fixed formatting mistake --- db/knex_migrations/2024-10-31-0000-fix-snmp-monitor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/knex_migrations/2024-10-31-0000-fix-snmp-monitor.js b/db/knex_migrations/2024-10-31-0000-fix-snmp-monitor.js index 94a3ac680a..0a605d38f2 100644 --- a/db/knex_migrations/2024-10-31-0000-fix-snmp-monitor.js +++ b/db/knex_migrations/2024-10-31-0000-fix-snmp-monitor.js @@ -1,7 +1,7 @@ exports.up = function (knex) { - return knex('monitor').whereNull('json_path_operator').update('json_path_operator', '=='); + return knex("monitor").whereNull("json_path_operator").update("json_path_operator", "=="); }; exports.down = function (knex) { - // changing the json_path_operator back to null for all '==' is not possible anymore + // changing the json_path_operator back to null for all "==" is not possible anymore // we have lost the context which fields have been set explicitely in >= v2.0 and which would need to be reverted };