aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrations
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2018-10-05 15:17:34 +0200
committerRigel Kent <sendmemail@rigelk.eu>2018-10-13 11:53:42 +0200
commit64cc5e8575fda47b281ae20abf0020e27fc8ce7c (patch)
treec3ec40b03d3fdc5d3beee9ff089384c894d9efe9 /server/initializers/migrations
parent0e5ff97f6fdf9a4cebe5a15f5a390380465803ad (diff)
downloadPeerTube-64cc5e8575fda47b281ae20abf0020e27fc8ce7c.tar.gz
PeerTube-64cc5e8575fda47b281ae20abf0020e27fc8ce7c.tar.zst
PeerTube-64cc5e8575fda47b281ae20abf0020e27fc8ce7c.zip
add webtorrent opt-out settings
- add a key in localstorage to remember the opt-out - add a user setting
Diffstat (limited to 'server/initializers/migrations')
-rw-r--r--server/initializers/migrations/0280-webtorrent-policy-user.ts26
1 files changed, 26 insertions, 0 deletions
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..d24f6709e
--- /dev/null
+++ b/server/initializers/migrations/0280-webtorrent-policy-user.ts
@@ -0,0 +1,26 @@
1import * as Sequelize from 'sequelize'
2import { values } from 'lodash'
3import { WEBTORRENT_POLICY_TYPES } from '../constants'
4
5async function up (utils: {
6 transaction: Sequelize.Transaction
7 queryInterface: Sequelize.QueryInterface
8 sequelize: Sequelize.Sequelize
9}): Promise<any> {
10 {
11 const data = {
12 type: Sequelize.ENUM(values(WEBTORRENT_POLICY_TYPES)),
13 allowNull: false,
14 defaultValue: 'enable'
15 }
16
17 await utils.queryInterface.addColumn('user', 'webTorrentPolicy', data)
18 }
19
20}
21
22function down (options) {
23 throw new Error('Not implemented.')
24}
25
26export { up, down }