uptime-kuma/db/knex_migrations/2023-06-30-1401-maintenance-cron.js
2023-06-30 17:26:37 +08:00

26 lines
794 B
JavaScript

/*
-- 999 characters. https://stackoverflow.com/questions/46134830/maximum-length-for-cron-job
DROP TABLE maintenance_timeslot;
ALTER TABLE maintenance ADD cron TEXT;
ALTER TABLE maintenance ADD timezone VARCHAR(255);
ALTER TABLE maintenance ADD duration INTEGER;
*/
exports.up = function (knex) {
return knex.schema
.dropTableIfExists("maintenance_timeslot")
.table("maintenance", function (table) {
table.text("cron");
table.string("timezone", 255);
table.integer("duration");
});
};
exports.down = function (knex) {
return knex.schema
.table("maintenance", function (table) {
table.dropColumn("cron");
table.dropColumn("timezone");
table.dropColumn("duration");
});
};