mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-27 16:54:04 +00:00
22 lines
780 B
JavaScript
22 lines
780 B
JavaScript
// ALTER TABLE monitor ADD http_body_encoding VARCHAR(25);
|
|
// UPDATE monitor SET http_body_encoding = 'json' WHERE (type = 'http' or type = 'keyword') AND http_body_encoding IS NULL;
|
|
exports.up = function (knex) {
|
|
return knex.schema.table("monitor", function (table) {
|
|
table.string("http_body_encoding", 25);
|
|
}).then(function () {
|
|
knex("monitor")
|
|
.where(function () {
|
|
this.where("type", "http").orWhere("type", "keyword");
|
|
})
|
|
.whereNull("http_body_encoding")
|
|
.update({
|
|
http_body_encoding: "json",
|
|
});
|
|
});
|
|
};
|
|
|
|
exports.down = function (knex) {
|
|
return knex.schema.table("monitor", function (table) {
|
|
table.dropColumn("http_body_encoding");
|
|
});
|
|
};
|