uptime-kuma/db/knex_migrations/2023-10-26-slow-response-notification.js

34 lines
1.7 KiB
JavaScript
Raw Normal View History

exports.up = function (knex) {
// add various slow_response_notification parameters
return knex.schema
.alterTable("monitor", function(table) {
table.boolean("slow_response_notification").notNullable().defaultTo(false);
table.string("slow_response_notification_method").notNullable().defaultTo("");
2023-11-08 14:50:03 -07:00
table.integer("slow_response_notification_range").notNullable().defaultTo(0);
table.string("slow_response_notification_threshold_method").notNullable().defaultTo("");
table.integer("slow_response_notification_threshold").notNullable().defaultTo(0);
table.float("slow_response_notification_threshold_multiplier").notNullable().defaultTo(0.0);
table.integer("slow_response_notification_resend_interval").notNullable().defaultTo(0);
})
.alterTable("heartbeat", function(table) {
table.integer("slow_response_count").notNullable().defaultTo(0);
});
}
exports.down = function (knex) {
2023-11-08 14:50:03 -07:00
// remove various slow_response_notification parameters
return knex.schema
.alterTable("monitor", function(table) {
2023-11-08 14:50:03 -07:00
table.dropColumn("slow_response_notification");
table.dropColumn("slow_response_notification_method");
table.dropColumn("slow_response_notification_range");
table.dropColumn("slow_response_notification_threshold_method");
table.dropColumn("slow_response_notification_threshold");
table.dropColumn("slow_response_notification_threshold_multiplier");
table.dropColumn("slow_response_notification_resend_interval");
})
.alterTable("heartbeat", function(table) {
2023-11-08 14:50:03 -07:00
table.dropColumn("slow_response_count");
});
}