From 1d49e1e27d63db1dfc9a7fd28c9902f488831a89 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 3 Apr 2017 21:24:36 +0200 Subject: Server: Add NSFW in user profile --- server/initializers/constants.js | 2 +- .../initializers/migrations/0045-user-display-nsfw.js | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 server/initializers/migrations/0045-user-display-nsfw.js (limited to 'server/initializers') 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') // --------------------------------------------------------------------------- -const LAST_MIGRATION_VERSION = 40 +const LAST_MIGRATION_VERSION = 45 // --------------------------------------------------------------------------- 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 @@ +'use strict' + +// utils = { transaction, queryInterface, sequelize, Sequelize } +exports.up = function (utils, finalCallback) { + const q = utils.queryInterface + const Sequelize = utils.Sequelize + + const data = { + type: Sequelize.BOOLEAN, + allowNull: false, + defaultValue: false + } + + q.addColumn('Users', 'displayNSFW', data, { transaction: utils.transaction }).asCallback(finalCallback) +} + +exports.down = function (options, callback) { + throw new Error('Not implemented.') +} -- cgit v1.2.3