mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-23 14:54:05 +00:00
Refactor migration to new knex migrations
This commit is contained in:
parent
e539e5aa73
commit
612581a5d5
3 changed files with 16 additions and 8 deletions
16
db/knex_migrations/2024-03-15-0000-hide-uptime-percentage.js
Normal file
16
db/knex_migrations/2024-03-15-0000-hide-uptime-percentage.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
exports.up = function (knex) {
|
||||
// Add new column status_page.hide_uptime_percentage
|
||||
return knex.schema
|
||||
.alterTable("status_page", function (table) {
|
||||
table.boolean("hide_uptime_percentage").notNullable().defaultTo(false);
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
exports.down = function (knex) {
|
||||
// Drop column status_page.hide_uptime_percentage
|
||||
return knex.schema
|
||||
.alterTable("status_page", function (table) {
|
||||
table.dropColumn("hide_uptime_percentage");
|
||||
});
|
||||
};
|
|
@ -1,7 +0,0 @@
|
|||
-- You should not modify if this have pushed to Github, unless it does serious wrong with the db.
|
||||
BEGIN TRANSACTION;
|
||||
|
||||
ALTER TABLE status_page
|
||||
ADD hide_uptime_percentage BOOLEAN default 0 NOT NULL;
|
||||
|
||||
COMMIT;
|
|
@ -106,7 +106,6 @@ class Database {
|
|||
"patch-notification-config.sql": true,
|
||||
"patch-fix-kafka-producer-booleans.sql": true,
|
||||
"patch-timeout.sql": true, // The last file so far converted to a knex migration file
|
||||
"patch-add-hide-uptime-percentage.sql": true
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue