2024-04-26 18:05:56 -07:00
|
|
|
exports.up = function (knex) {
|
|
|
|
return knex.schema
|
|
|
|
.alterTable("monitor", function (table) {
|
2024-04-29 14:59:21 -07:00
|
|
|
table.string("snmp_community_string", 255).defaultTo("public"); // Add snmp_community_string column
|
2024-04-30 14:10:43 -07:00
|
|
|
table.string("snmp_oid").defaultTo(null); // Add oid column
|
2024-05-07 07:28:27 -07:00
|
|
|
table.enum("snmp_version", [ "0", "1", "3" ]).defaultTo("1"); // Add snmp_version column with enum values (0: SNMPv1, 1: SNMPv2c, 3: SNMPv3)
|
2024-04-30 14:10:43 -07:00
|
|
|
table.float("snmp_control_value").defaultTo(null); // Add control_value column as float
|
|
|
|
table.string("snmp_condition").defaultTo(null); // Add oid column
|
2024-04-26 18:05:56 -07:00
|
|
|
});
|
2024-04-30 14:10:43 -07:00
|
|
|
};
|
2024-04-30 14:11:21 -07:00
|
|
|
|
|
|
|
exports.down = function (knex) {
|
2024-04-30 17:06:03 -07:00
|
|
|
return knex.schema.alterTable("monitor", function (table) {
|
|
|
|
table.dropColumn("snmp_community_string");
|
|
|
|
table.dropColumn("snmp_oid");
|
|
|
|
table.dropColumn("snmp_version");
|
|
|
|
table.dropColumn("snmp_control_value");
|
|
|
|
table.dropColumn("snmp_condition");
|
|
|
|
});
|
2024-04-30 17:04:59 -07:00
|
|
|
};
|