From 64cc5e8575fda47b281ae20abf0020e27fc8ce7c Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Fri, 5 Oct 2018 15:17:34 +0200 Subject: add webtorrent opt-out settings - add a key in localstorage to remember the opt-out - add a user setting --- .../migrations/0280-webtorrent-policy-user.ts | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 server/initializers/migrations/0280-webtorrent-policy-user.ts (limited to 'server/initializers/migrations/0280-webtorrent-policy-user.ts') 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 @@ +import * as Sequelize from 'sequelize' +import { values } from 'lodash' +import { WEBTORRENT_POLICY_TYPES } from '../constants' + +async function up (utils: { + transaction: Sequelize.Transaction + queryInterface: Sequelize.QueryInterface + sequelize: Sequelize.Sequelize +}): Promise { + { + const data = { + type: Sequelize.ENUM(values(WEBTORRENT_POLICY_TYPES)), + allowNull: false, + defaultValue: 'enable' + } + + await utils.queryInterface.addColumn('user', 'webTorrentPolicy', data) + } + +} + +function down (options) { + throw new Error('Not implemented.') +} + +export { up, down } -- cgit v1.2.3