From c3b4ad85e5b55be2b23e584b75c031fefb5e29c2 Mon Sep 17 00:00:00 2001 From: Wampie Driessen <1059058+wampiedriessen@users.noreply.github.com> Date: Wed, 13 Sep 2023 11:32:55 +0200 Subject: [PATCH] Convert migration to knex migration --- .../2023-09-13-1047-locale-on-statuspage.js | 15 +++++++++++++++ db/patch-status-page-locale-selector.sql | 5 ----- 2 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 db/knex_migrations/2023-09-13-1047-locale-on-statuspage.js delete mode 100644 db/patch-status-page-locale-selector.sql diff --git a/db/knex_migrations/2023-09-13-1047-locale-on-statuspage.js b/db/knex_migrations/2023-09-13-1047-locale-on-statuspage.js new file mode 100644 index 000000000..1f7a13937 --- /dev/null +++ b/db/knex_migrations/2023-09-13-1047-locale-on-statuspage.js @@ -0,0 +1,15 @@ +exports.up = function (knex) { + return knex.schema + .alterTable("status_page", function (table) { + table.boolean("show_locale_selector").notNullable().defaultTo(false); + table.string("default_locale").nullable().defaultTo(""); + }); +}; + +exports.down = function (knex) { + return knex.schema + .alterTable("status_page", function (table) { + table.dropColumn("default_locale"); + table.dropColumn("show_locale_selector"); + }); +}; diff --git a/db/patch-status-page-locale-selector.sql b/db/patch-status-page-locale-selector.sql deleted file mode 100644 index 3335e3ba0..000000000 --- a/db/patch-status-page-locale-selector.sql +++ /dev/null @@ -1,5 +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 show_locale_selector BOOLEAN NOT NULL DEFAULT 0; -ALTER TABLE status_page ADD default_locale TEXT DEFAULT ""; -COMMIT;