aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrations/0045-user-display-nsfw.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-07-05 13:26:25 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-07-05 14:14:16 +0200
commit6fcd19ba737f1f5614a56c6925adb882dea43b8d (patch)
tree3365a96d82bc7f00ae504a568725c8e914150cf8 /server/initializers/migrations/0045-user-display-nsfw.ts
parent5fe7e898316e18369c3e1aba307b55077adc7bfb (diff)
downloadPeerTube-6fcd19ba737f1f5614a56c6925adb882dea43b8d.tar.gz
PeerTube-6fcd19ba737f1f5614a56c6925adb882dea43b8d.tar.zst
PeerTube-6fcd19ba737f1f5614a56c6925adb882dea43b8d.zip
Move to promises
Closes https://github.com/Chocobozzz/PeerTube/issues/74
Diffstat (limited to 'server/initializers/migrations/0045-user-display-nsfw.ts')
-rw-r--r--server/initializers/migrations/0045-user-display-nsfw.ts13
1 files changed, 9 insertions, 4 deletions
diff --git a/server/initializers/migrations/0045-user-display-nsfw.ts b/server/initializers/migrations/0045-user-display-nsfw.ts
index 1ca317795..75bd3bbea 100644
--- a/server/initializers/migrations/0045-user-display-nsfw.ts
+++ b/server/initializers/migrations/0045-user-display-nsfw.ts
@@ -1,7 +1,12 @@
1// utils = { transaction, queryInterface, sequelize, Sequelize } 1import * as Sequelize from 'sequelize'
2function up (utils, finalCallback) { 2import * as Promise from 'bluebird'
3
4function up (utils: {
5 transaction: Sequelize.Transaction,
6 queryInterface: Sequelize.QueryInterface,
7 sequelize: Sequelize.Sequelize
8}): Promise<void> {
3 const q = utils.queryInterface 9 const q = utils.queryInterface
4 const Sequelize = utils.Sequelize
5 10
6 const data = { 11 const data = {
7 type: Sequelize.BOOLEAN, 12 type: Sequelize.BOOLEAN,
@@ -9,7 +14,7 @@ function up (utils, finalCallback) {
9 defaultValue: false 14 defaultValue: false
10 } 15 }
11 16
12 q.addColumn('Users', 'displayNSFW', data, { transaction: utils.transaction }).asCallback(finalCallback) 17 return q.addColumn('Users', 'displayNSFW', data)
13} 18}
14 19
15function down (options, callback) { 20function down (options, callback) {