diff --git a/db/knex_migrations/2024-03-15-0000-hide-uptime-percentage.js b/db/knex_migrations/2024-03-15-0000-hide-uptime-percentage.js new file mode 100644 index 00000000..f13b4ae3 --- /dev/null +++ b/db/knex_migrations/2024-03-15-0000-hide-uptime-percentage.js @@ -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"); + }); +}; \ No newline at end of file diff --git a/db/patch-add-hide-uptime-percentage.sql b/db/patch-add-hide-uptime-percentage.sql deleted file mode 100644 index 263a90ad..00000000 --- a/db/patch-add-hide-uptime-percentage.sql +++ /dev/null @@ -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; diff --git a/server/database.js b/server/database.js index 01bbc200..cfe14fe7 100644 --- a/server/database.js +++ b/server/database.js @@ -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 }; /**