aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrations
diff options
context:
space:
mode:
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 }