mirror of
https://github.com/louislam/uptime-kuma.git
synced 2026-02-11 08:08:32 +01:00
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: louislam <1336778+louislam@users.noreply.github.com> Co-authored-by: CommanderStorm <26258709+CommanderStorm@users.noreply.github.com>
43 lines
1.9 KiB
JavaScript
43 lines
1.9 KiB
JavaScript
exports.up = function (knex) {
|
|
return knex.schema
|
|
.alterTable("heartbeat", function (table) {
|
|
table.bigInteger("ping").alter();
|
|
})
|
|
.alterTable("stat_minutely", function (table) {
|
|
table.float("ping", 20, 2).notNullable().alter();
|
|
table.float("ping_min", 20, 2).notNullable().defaultTo(0).alter();
|
|
table.float("ping_max", 20, 2).notNullable().defaultTo(0).alter();
|
|
})
|
|
.alterTable("stat_daily", function (table) {
|
|
table.float("ping", 20, 2).notNullable().alter();
|
|
table.float("ping_min", 20, 2).notNullable().defaultTo(0).alter();
|
|
table.float("ping_max", 20, 2).notNullable().defaultTo(0).alter();
|
|
})
|
|
.alterTable("stat_hourly", function (table) {
|
|
table.float("ping", 20, 2).notNullable().alter();
|
|
table.float("ping_min", 20, 2).notNullable().defaultTo(0).alter();
|
|
table.float("ping_max", 20, 2).notNullable().defaultTo(0).alter();
|
|
});
|
|
};
|
|
|
|
exports.down = function (knex) {
|
|
return knex.schema
|
|
.alterTable("heartbeat", function (table) {
|
|
table.integer("ping").alter();
|
|
})
|
|
.alterTable("stat_minutely", function (table) {
|
|
table.float("ping").notNullable().alter();
|
|
table.float("ping_min").notNullable().defaultTo(0).alter();
|
|
table.float("ping_max").notNullable().defaultTo(0).alter();
|
|
})
|
|
.alterTable("stat_daily", function (table) {
|
|
table.float("ping").notNullable().alter();
|
|
table.float("ping_min").notNullable().defaultTo(0).alter();
|
|
table.float("ping_max").notNullable().defaultTo(0).alter();
|
|
})
|
|
.alterTable("stat_hourly", function (table) {
|
|
table.float("ping").notNullable().alter();
|
|
table.float("ping_min").notNullable().defaultTo(0).alter();
|
|
table.float("ping_max").notNullable().defaultTo(0).alter();
|
|
});
|
|
};
|