Fix migrations
authorChocobozzz <me@florianbigard.com>
Fri, 6 Sep 2019 06:59:02 +0000 (08:59 +0200)
committerChocobozzz <me@florianbigard.com>
Fri, 6 Sep 2019 06:59:02 +0000 (08:59 +0200)
server/initializers/constants.ts
server/initializers/migrations/0425-user-modals.ts [deleted file]
server/initializers/migrations/0435-user-modals.ts [new file with mode: 0644]

index 01d4f1d74aebb8ec61164129a9b987f333e7b54b..be4a664889b9f7bcf2937d2c75349e08b6133fb8 100644 (file)
@@ -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 (file)
index 5c2aa85..0000000
+++ /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<void> {
-  {
-    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 (file)
index 0000000..5c2aa85
--- /dev/null
@@ -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<void> {
+  {
+    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
+}