Refactor migration to new knex migrations

pull/4587/head
Bas Wieringa 2 months ago
parent e539e5aa73
commit 612581a5d5

@ -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…
Cancel
Save