From: Chocobozzz <me@florianbigard.com>
Date: Fri, 6 Sep 2019 06:59:02 +0000 (+0200)
Subject: Fix migrations
X-Git-Tag: v2.0.0-rc.1~70
X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=5faed166535b34bde56bda7c123654cf655a0541;p=oweals%2Fpeertube.git

Fix migrations
---

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<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
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<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
+}