From 138075a2af26414dfb0f014cc1cd050bfcd58395 Mon Sep 17 00:00:00 2001 From: Matt Visnovsky Date: Tue, 30 Apr 2024 15:10:43 -0600 Subject: [PATCH] Update db migration: allow nulls DB must allow nulls otherwise this will break other monitors. --- db/knex_migrations/2024-04-26-0000-snmp-monitor.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/db/knex_migrations/2024-04-26-0000-snmp-monitor.js b/db/knex_migrations/2024-04-26-0000-snmp-monitor.js index 489a4424..2a5604b3 100644 --- a/db/knex_migrations/2024-04-26-0000-snmp-monitor.js +++ b/db/knex_migrations/2024-04-26-0000-snmp-monitor.js @@ -2,9 +2,10 @@ exports.up = function (knex) { return knex.schema .alterTable("monitor", function (table) { table.string("snmp_community_string", 255).defaultTo("public"); // Add snmp_community_string column - table.string("snmp_oid").notNullable(); // Add oid column + table.string("snmp_oid").defaultTo(null); // Add oid column table.enum("snmp_version", ["1", "2c", "3"]).defaultTo("2c"); // Add snmp_version column with enum values - table.float("snmp_control_value").notNullable(); // Add control_value column as float - table.string("snmp_condition").notNullable(); // Add oid column + table.float("snmp_control_value").defaultTo(null); // Add control_value column as float + table.string("snmp_condition").defaultTo(null); // Add oid column }); +}; }; \ No newline at end of file