aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-10-17 10:48:56 +0200
committerChocobozzz <me@florianbigard.com>2018-10-17 10:48:56 +0200
commitbb5d90e62f631af3c899fbe586485e64938a5927 (patch)
tree8dc28c7027a52bed76bcc7e117da290ff7a58b6b /server/initializers
parentbcf21a376f1e26cb3e74236e4cc41909310d4c32 (diff)
parenta73115f31ae891cb47759f075b1d2cead40817a4 (diff)
downloadPeerTube-bb5d90e62f631af3c899fbe586485e64938a5927.tar.gz
PeerTube-bb5d90e62f631af3c899fbe586485e64938a5927.tar.zst
PeerTube-bb5d90e62f631af3c899fbe586485e64938a5927.zip
Merge branch 'feature/webtorrent-disabling' into develop
Diffstat (limited to 'server/initializers')
-rw-r--r--server/initializers/constants.ts2
-rw-r--r--server/initializers/migrations/0280-webtorrent-policy-user.ts28
2 files changed, 29 insertions, 1 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index cf00da2c7..03158e356 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -16,7 +16,7 @@ let config: IConfig = require('config')
16 16
17// --------------------------------------------------------------------------- 17// ---------------------------------------------------------------------------
18 18
19const LAST_MIGRATION_VERSION = 275 19const LAST_MIGRATION_VERSION = 280
20 20
21// --------------------------------------------------------------------------- 21// ---------------------------------------------------------------------------
22 22
diff --git a/server/initializers/migrations/0280-webtorrent-policy-user.ts b/server/initializers/migrations/0280-webtorrent-policy-user.ts
new file mode 100644
index 000000000..e6488356a
--- /dev/null
+++ b/server/initializers/migrations/0280-webtorrent-policy-user.ts
@@ -0,0 +1,28 @@
1import * as Sequelize from 'sequelize'
2
3async function up (utils: {
4 transaction: Sequelize.Transaction
5 queryInterface: Sequelize.QueryInterface
6 sequelize: Sequelize.Sequelize
7}): Promise<any> {
8 {
9 const data = {
10 type: Sequelize.BOOLEAN,
11 allowNull: false,
12 defaultValue: true
13 }
14
15 await utils.queryInterface.addColumn('user', 'webTorrentEnabled', data)
16 }
17
18}
19
20async function down (utils: {
21 transaction: Sequelize.Transaction
22 queryInterface: Sequelize.QueryInterface
23 sequelize: Sequelize.Sequelize
24}): Promise<any> {
25 await utils.queryInterface.removeColumn('user', 'webTorrentEnabled')
26}
27
28export { up, down }