From: Rigel Kent Date: Tue, 5 May 2020 11:52:10 +0000 (+0200) Subject: Fix plugin-auth migration X-Git-Tag: v2.2.0-rc.1~92 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=5140edafeb312136d44d9437884d86948f2a6e2a;p=oweals%2Fpeertube.git Fix plugin-auth migration --- diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index c8e50dd53..5ce8819ec 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -14,7 +14,7 @@ import { CONFIG, registerConfigChangedHandler } from './config' // --------------------------------------------------------------------------- -const LAST_MIGRATION_VERSION = 490 +const LAST_MIGRATION_VERSION = 495 // --------------------------------------------------------------------------- diff --git a/server/initializers/migrations/0490-plugin-auth.ts b/server/initializers/migrations/0490-plugin-auth.ts deleted file mode 100644 index ea636a4ad..000000000 --- a/server/initializers/migrations/0490-plugin-auth.ts +++ /dev/null @@ -1,42 +0,0 @@ -import * as Sequelize from 'sequelize' - -async function up (utils: { - transaction: Sequelize.Transaction - queryInterface: Sequelize.QueryInterface - sequelize: Sequelize.Sequelize -}): Promise { - - { - const password = { - type: Sequelize.STRING, - allowNull: true - } - await utils.queryInterface.changeColumn('user', 'password', password) - } - - { - const pluginAuth = { - type: Sequelize.STRING, - allowNull: true - } - await utils.queryInterface.addColumn('user', 'pluginAuth', pluginAuth) - } - - { - const authName = { - type: Sequelize.STRING, - allowNull: true - } - await utils.queryInterface.addColumn('oAuthToken', 'authName', authName) - } - -} - -function down (options) { - throw new Error('Not implemented.') -} - -export { - up, - down -} diff --git a/server/initializers/migrations/0495-plugin-auth.ts b/server/initializers/migrations/0495-plugin-auth.ts new file mode 100644 index 000000000..ea636a4ad --- /dev/null +++ b/server/initializers/migrations/0495-plugin-auth.ts @@ -0,0 +1,42 @@ +import * as Sequelize from 'sequelize' + +async function up (utils: { + transaction: Sequelize.Transaction + queryInterface: Sequelize.QueryInterface + sequelize: Sequelize.Sequelize +}): Promise { + + { + const password = { + type: Sequelize.STRING, + allowNull: true + } + await utils.queryInterface.changeColumn('user', 'password', password) + } + + { + const pluginAuth = { + type: Sequelize.STRING, + allowNull: true + } + await utils.queryInterface.addColumn('user', 'pluginAuth', pluginAuth) + } + + { + const authName = { + type: Sequelize.STRING, + allowNull: true + } + await utils.queryInterface.addColumn('oAuthToken', 'authName', authName) + } + +} + +function down (options) { + throw new Error('Not implemented.') +} + +export { + up, + down +}