Simplified and secured Local Service monitor

This commit is contained in:
iotux
2025-12-14 16:39:00 +01:00
parent 2ffc06d950
commit d76ce4e28d
6 changed files with 41 additions and 120 deletions
@@ -4,9 +4,7 @@
*/
exports.up = async (knex) => {
await knex.schema.alterTable("monitor", (table) => {
table.string("local_service_command");
table.string("local_service_expected_output");
table.string("local_service_check_type").notNullable().defaultTo("keyword");
table.string("local_service_name");
});
};
@@ -15,19 +13,7 @@ exports.up = async (knex) => {
* @returns {Promise<void>}
*/
exports.down = async (knex) => {
if (await knex.schema.hasColumn("monitor", "local_service_command")) {
await knex.schema.alterTable("monitor", (table) => {
table.dropColumn("local_service_command");
});
}
if (await knex.schema.hasColumn("monitor", "local_service_expected_output")) {
await knex.schema.alterTable("monitor", (table) => {
table.dropColumn("local_service_expected_output");
});
}
if (await knex.schema.hasColumn("monitor", "local_service_check_type")) {
await knex.schema.alterTable("monitor", (table) => {
table.dropColumn("local_service_check_type");
});
}
await knex.schema.alterTable("monitor", (table) => {
table.dropColumn("local_service_name");
});
};