Add auto play next video migration
authorChocobozzz <me@florianbigard.com>
Tue, 24 Sep 2019 08:35:36 +0000 (10:35 +0200)
committerChocobozzz <me@florianbigard.com>
Tue, 24 Sep 2019 08:35:36 +0000 (10:35 +0200)
client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.html
server/initializers/constants.ts
server/initializers/migrations/0440-user-auto-play-next-video.ts [new file with mode: 0644]

index 06fd9833a5005e0f015e7d580ddeb34ec1fd6ccf..84c78c457e86ccdcf80244d78c6346a841655da7 100644 (file)
@@ -47,7 +47,9 @@
       inputName="autoPlayVideo" formControlName="autoPlayVideo"
       i18n-labelText labelText="Automatically plays video"
     ></my-peertube-checkbox>
+  </div>
 
+  <div class="form-group">
     <my-peertube-checkbox
       inputName="autoPlayNextVideo" formControlName="autoPlayNextVideo"
       i18n-labelText labelText="Automatically starts playing next video"
index be4a664889b9f7bcf2937d2c75349e08b6133fb8..332b57cf2e79ae2ee7a23bc5adfabc5c2eecc966 100644 (file)
@@ -14,7 +14,7 @@ import { CONFIG, registerConfigChangedHandler } from './config'
 
 // ---------------------------------------------------------------------------
 
-const LAST_MIGRATION_VERSION = 435
+const LAST_MIGRATION_VERSION = 440
 
 // ---------------------------------------------------------------------------
 
diff --git a/server/initializers/migrations/0440-user-auto-play-next-video.ts b/server/initializers/migrations/0440-user-auto-play-next-video.ts
new file mode 100644 (file)
index 0000000..f0baafe
--- /dev/null
@@ -0,0 +1,27 @@
+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', 'autoPlayNextVideo', data)
+  }
+}
+
+function down (options) {
+  throw new Error('Not implemented.')
+}
+
+export {
+  up,
+  down
+}