Fix plugin-auth migration
authorRigel Kent <sendmemail@rigelk.eu>
Tue, 5 May 2020 11:52:10 +0000 (13:52 +0200)
committerRigel Kent <sendmemail@rigelk.eu>
Tue, 5 May 2020 11:52:10 +0000 (13:52 +0200)
server/initializers/constants.ts
server/initializers/migrations/0490-plugin-auth.ts [deleted file]
server/initializers/migrations/0495-plugin-auth.ts [new file with mode: 0644]

index c8e50dd53b681b01ae2152f04fe92c4fce494588..5ce8819ec8cc021b8ffe197fb7aec626109dee5c 100644 (file)
@@ -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 (file)
index ea636a4..0000000
+++ /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<void> {
-
-  {
-    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 (file)
index 0000000..ea636a4
--- /dev/null
@@ -0,0 +1,42 @@
+import * as Sequelize from 'sequelize'
+
+async function up (utils: {
+  transaction: Sequelize.Transaction
+  queryInterface: Sequelize.QueryInterface
+  sequelize: Sequelize.Sequelize
+}): Promise<void> {
+
+  {
+    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
+}