From 5faed166535b34bde56bda7c123654cf655a0541 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 6 Sep 2019 08:59:02 +0200 Subject: Fix migrations --- server/initializers/constants.ts | 2 +- server/initializers/migrations/0425-user-modals.ts | 40 ---------------------- server/initializers/migrations/0435-user-modals.ts | 40 ++++++++++++++++++++++ 3 files changed, 41 insertions(+), 41 deletions(-) delete mode 100644 server/initializers/migrations/0425-user-modals.ts create mode 100644 server/initializers/migrations/0435-user-modals.ts (limited to 'server/initializers') diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 01d4f1d74..be4a66488 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -14,7 +14,7 @@ import { CONFIG, registerConfigChangedHandler } from './config' // --------------------------------------------------------------------------- -const LAST_MIGRATION_VERSION = 430 +const LAST_MIGRATION_VERSION = 435 // --------------------------------------------------------------------------- diff --git a/server/initializers/migrations/0425-user-modals.ts b/server/initializers/migrations/0425-user-modals.ts deleted file mode 100644 index 5c2aa85b5..000000000 --- a/server/initializers/migrations/0425-user-modals.ts +++ /dev/null @@ -1,40 +0,0 @@ -import * as Sequelize from 'sequelize' - -async function up (utils: { - transaction: Sequelize.Transaction, - queryInterface: Sequelize.QueryInterface, - sequelize: Sequelize.Sequelize, - db: any -}): Promise { - { - const data = { - type: Sequelize.BOOLEAN, - allowNull: false, - defaultValue: false - } - - await utils.queryInterface.addColumn('user', 'noInstanceConfigWarningModal', data) - } - - { - const data = { - type: Sequelize.BOOLEAN, - allowNull: false, - defaultValue: true - } - - await utils.queryInterface.addColumn('user', 'noWelcomeModal', data) - data.defaultValue = false - - await utils.queryInterface.changeColumn('user', 'noWelcomeModal', data) - } -} - -function down (options) { - throw new Error('Not implemented.') -} - -export { - up, - down -} diff --git a/server/initializers/migrations/0435-user-modals.ts b/server/initializers/migrations/0435-user-modals.ts new file mode 100644 index 000000000..5c2aa85b5 --- /dev/null +++ b/server/initializers/migrations/0435-user-modals.ts @@ -0,0 +1,40 @@ +import * as Sequelize from 'sequelize' + +async function up (utils: { + transaction: Sequelize.Transaction, + queryInterface: Sequelize.QueryInterface, + sequelize: Sequelize.Sequelize, + db: any +}): Promise { + { + const data = { + type: Sequelize.BOOLEAN, + allowNull: false, + defaultValue: false + } + + await utils.queryInterface.addColumn('user', 'noInstanceConfigWarningModal', data) + } + + { + const data = { + type: Sequelize.BOOLEAN, + allowNull: false, + defaultValue: true + } + + await utils.queryInterface.addColumn('user', 'noWelcomeModal', data) + data.defaultValue = false + + await utils.queryInterface.changeColumn('user', 'noWelcomeModal', data) + } +} + +function down (options) { + throw new Error('Not implemented.') +} + +export { + up, + down +} -- cgit v1.2.3