1
0
mirror of https://github.com/louislam/uptime-kuma.git synced 2025-10-30 23:58:13 +02:00

Fix: Set default value for ping column to 0 in stat tables (#6188)

This commit is contained in:
Louis Lam
2025-10-16 07:30:26 +08:00
committed by GitHub
parent 2d50d68da0
commit 5f650aef58

View File

@@ -0,0 +1,27 @@
// Fix for #4315. Logically, setting it to 0 ping may not be correct, but it is better than throwing errors
exports.up = function (knex) {
return knex.schema
.alterTable("stat_daily", function (table) {
table.integer("ping").defaultTo(0).alter();
})
.alterTable("stat_hourly", function (table) {
table.integer("ping").defaultTo(0).alter();
})
.alterTable("stat_minutely", function (table) {
table.integer("ping").defaultTo(0).alter();
});
};
exports.down = function (knex) {
return knex.schema
.alterTable("stat_daily", function (table) {
table.integer("ping").alter();
})
.alterTable("stat_hourly", function (table) {
table.integer("ping").alter();
})
.alterTable("stat_minutely", function (table) {
table.integer("ping").alter();
});
};