mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-19 20:54:36 -05:00
19 lines
517 B
JavaScript
19 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");
|
||
|
});
|
||
|
};
|