Fix playlist description length
authorChocobozzz <me@florianbigard.com>
Tue, 5 May 2020 14:34:50 +0000 (16:34 +0200)
committerChocobozzz <me@florianbigard.com>
Tue, 5 May 2020 14:34:50 +0000 (16:34 +0200)
server/initializers/constants.ts
server/initializers/migrations/0500-playlist-description-length.ts [new file with mode: 0644]

index 5ce8819ec8cc021b8ffe197fb7aec626109dee5c..d583912fb7c247a329a2a56debcc5e0fb3d96d8e 100644 (file)
@@ -14,7 +14,7 @@ import { CONFIG, registerConfigChangedHandler } from './config'
 
 // ---------------------------------------------------------------------------
 
-const LAST_MIGRATION_VERSION = 495
+const LAST_MIGRATION_VERSION = 500
 
 // ---------------------------------------------------------------------------
 
diff --git a/server/initializers/migrations/0500-playlist-description-length.ts b/server/initializers/migrations/0500-playlist-description-length.ts
new file mode 100644 (file)
index 0000000..f47f3d9
--- /dev/null
@@ -0,0 +1,26 @@
+import * as Sequelize from 'sequelize'
+
+async function up (utils: {
+  transaction: Sequelize.Transaction
+  queryInterface: Sequelize.QueryInterface
+  sequelize: Sequelize.Sequelize
+}): Promise<void> {
+
+  {
+    const description = {
+      type: Sequelize.STRING(1000),
+      allowNull: true
+    }
+    await utils.queryInterface.changeColumn('videoPlaylist', 'description', description)
+  }
+
+}
+
+function down (options) {
+  throw new Error('Not implemented.')
+}
+
+export {
+  up,
+  down
+}