aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrations/0280-video-downloading-enabled.ts
diff options
context:
space:
mode:
authorLucas Declercq <lucas.declercq@ineat-conseil.fr>2018-10-06 19:17:21 +0200
committerLucas Declercq <lucas.declercq@ineat-conseil.fr>2018-10-06 19:17:39 +0200
commit156c50af3085468a47b8ae73fe8cfcae46b42398 (patch)
treef316355ebea2550c201a880cfc9f9b724bf0f7fd /server/initializers/migrations/0280-video-downloading-enabled.ts
parent35d50b7dd26b3cf646b8845784927bb1ef18dfb3 (diff)
downloadPeerTube-156c50af3085468a47b8ae73fe8cfcae46b42398.tar.gz
PeerTube-156c50af3085468a47b8ae73fe8cfcae46b42398.tar.zst
PeerTube-156c50af3085468a47b8ae73fe8cfcae46b42398.zip
Add downloadingEnabled property to video model
Diffstat (limited to 'server/initializers/migrations/0280-video-downloading-enabled.ts')
-rw-r--r--server/initializers/migrations/0280-video-downloading-enabled.ts27
1 files changed, 27 insertions, 0 deletions
diff --git a/server/initializers/migrations/0280-video-downloading-enabled.ts b/server/initializers/migrations/0280-video-downloading-enabled.ts
new file mode 100644
index 000000000..c0700108c
--- /dev/null
+++ b/server/initializers/migrations/0280-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', 'downloadingEnabled', data)
15
16 data.defaultValue = null
17 return utils.queryInterface.changeColumn('video', 'downloadingEnabled', data)
18}
19
20function down (options) {
21 throw new Error('Not implemented.')
22}
23
24export {
25 up,
26 down
27}