mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-02-06 19:53:50 +00:00
18 lines
517 B
JavaScript
18 lines
517 B
JavaScript
/*
|
|
ALTER TABLE monitor
|
|
ADD parent INTEGER REFERENCES [monitor] ([id]) ON DELETE SET NULL ON UPDATE CASCADE;
|
|
*/
|
|
exports.up = function (knex) {
|
|
return knex.schema.table("monitor", function (table) {
|
|
table.integer("parent").unsigned()
|
|
.references("id").inTable("monitor")
|
|
.onDelete("SET NULL")
|
|
.onUpdate("CASCADE");
|
|
});
|
|
};
|
|
|
|
exports.down = function (knex) {
|
|
return knex.schema.table("monitor", function (table) {
|
|
table.dropColumn("parent");
|
|
});
|
|
};
|