You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
uptime-kuma/db/knex_migrations/2023-11-09-slow-response-no...

34 lines
1.8 KiB

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("average");
table.integer("slow_response_notification_range").notNullable().defaultTo(300);
table.string("slow_response_notification_threshold_method").notNullable().defaultTo("threshold-relative-24-hour");
table.integer("slow_response_notification_threshold").notNullable().defaultTo(2500);
table.float("slow_response_notification_threshold_multiplier").notNullable().defaultTo(5.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) {
// remove various slow_response_notification parameters
return knex.schema
.alterTable("monitor", function (table) {
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) {
table.dropColumn("slow_response_count");
});
};