diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-04-03 21:24:36 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-04-03 21:24:36 +0200 |
commit | 1d49e1e27d63db1dfc9a7fd28c9902f488831a89 (patch) | |
tree | ce3353ad691876c55ce8fcfdd70bfa2b9112b39a /server/initializers | |
parent | 31b59b477459d4f26ed8ef089a0e5553fb6a332b (diff) | |
download | PeerTube-1d49e1e27d63db1dfc9a7fd28c9902f488831a89.tar.gz PeerTube-1d49e1e27d63db1dfc9a7fd28c9902f488831a89.tar.zst PeerTube-1d49e1e27d63db1dfc9a7fd28c9902f488831a89.zip |
Server: Add NSFW in user profile
Diffstat (limited to 'server/initializers')
-rw-r--r-- | server/initializers/constants.js | 2 | ||||
-rw-r--r-- | server/initializers/migrations/0045-user-display-nsfw.js | 19 |
2 files changed, 20 insertions, 1 deletions
diff --git a/server/initializers/constants.js b/server/initializers/constants.js index f3799ba0f..6352d7c46 100644 --- a/server/initializers/constants.js +++ b/server/initializers/constants.js | |||
@@ -5,7 +5,7 @@ const path = require('path') | |||
5 | 5 | ||
6 | // --------------------------------------------------------------------------- | 6 | // --------------------------------------------------------------------------- |
7 | 7 | ||
8 | const LAST_MIGRATION_VERSION = 40 | 8 | const LAST_MIGRATION_VERSION = 45 |
9 | 9 | ||
10 | // --------------------------------------------------------------------------- | 10 | // --------------------------------------------------------------------------- |
11 | 11 | ||
diff --git a/server/initializers/migrations/0045-user-display-nsfw.js b/server/initializers/migrations/0045-user-display-nsfw.js new file mode 100644 index 000000000..03624e593 --- /dev/null +++ b/server/initializers/migrations/0045-user-display-nsfw.js | |||
@@ -0,0 +1,19 @@ | |||
1 | 'use strict' | ||
2 | |||
3 | // utils = { transaction, queryInterface, sequelize, Sequelize } | ||
4 | exports.up = function (utils, finalCallback) { | ||
5 | const q = utils.queryInterface | ||
6 | const Sequelize = utils.Sequelize | ||
7 | |||
8 | const data = { | ||
9 | type: Sequelize.BOOLEAN, | ||
10 | allowNull: false, | ||
11 | defaultValue: false | ||
12 | } | ||
13 | |||
14 | q.addColumn('Users', 'displayNSFW', data, { transaction: utils.transaction }).asCallback(finalCallback) | ||
15 | } | ||
16 | |||
17 | exports.down = function (options, callback) { | ||
18 | throw new Error('Not implemented.') | ||
19 | } | ||