aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrations/0335-video-downloading-enabled.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-02-11 11:55:11 +0100
committerChocobozzz <me@florianbigard.com>2019-02-11 11:55:11 +0100
commit25451e08c71b81ee3da75d65eab22445a78dd0c2 (patch)
treeb5d3a08b66183a76db6ccabb69a19ff9fe928d75 /server/initializers/migrations/0335-video-downloading-enabled.ts
parent88108880bbdba473cfe36ecbebc1c3c4f972e102 (diff)
downloadPeerTube-25451e08c71b81ee3da75d65eab22445a78dd0c2.tar.gz
PeerTube-25451e08c71b81ee3da75d65eab22445a78dd0c2.tar.zst
PeerTube-25451e08c71b81ee3da75d65eab22445a78dd0c2.zip
Update migration version for download enabled
Diffstat (limited to 'server/initializers/migrations/0335-video-downloading-enabled.ts')
-rw-r--r--server/initializers/migrations/0335-video-downloading-enabled.ts27
1 files changed, 27 insertions, 0 deletions
diff --git a/server/initializers/migrations/0335-video-downloading-enabled.ts b/server/initializers/migrations/0335-video-downloading-enabled.ts
new file mode 100644
index 000000000..e79466447
--- /dev/null
+++ b/server/initializers/migrations/0335-video-downloading-enabled.ts
@@ -0,0 +1,27 @@
1import * as Sequelize from 'sequelize'
2import { Migration } from '../../models/migrations'
3
4async function up (utils: {
5 transaction: Sequelize.Transaction,
6 queryInterface: Sequelize.QueryInterface,
7 sequelize: Sequelize.Sequelize
8}): Promise<void> {
9 const data = {
10 type: Sequelize.BOOLEAN,
11 allowNull: false,
12 defaultValue: true
13 } as Migration.Boolean
14 await utils.queryInterface.addColumn('video', 'downloadEnabled', data)
15
16 data.defaultValue = null
17 return utils.queryInterface.changeColumn('video', 'downloadEnabled', data)
18}
19
20function down (options) {
21 throw new Error('Not implemented.')
22}
23
24export {
25 up,
26 down
27}