From 47564bbe2eeb2baae9b7e3f9b2b8d16522bc7e04 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 3 Jan 2018 10:12:36 +0100 Subject: Add ability to disable video comments --- .../migrations/0155-video-comments-enabled.ts | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 server/initializers/migrations/0155-video-comments-enabled.ts (limited to 'server/initializers/migrations') diff --git a/server/initializers/migrations/0155-video-comments-enabled.ts b/server/initializers/migrations/0155-video-comments-enabled.ts new file mode 100644 index 000000000..59f4110de --- /dev/null +++ b/server/initializers/migrations/0155-video-comments-enabled.ts @@ -0,0 +1,26 @@ +import * as Sequelize from 'sequelize' + +async function up (utils: { + transaction: Sequelize.Transaction, + queryInterface: Sequelize.QueryInterface, + sequelize: Sequelize.Sequelize +}): Promise { + const data = { + type: Sequelize.BOOLEAN, + allowNull: false, + defaultValue: true + } + await utils.queryInterface.addColumn('video', 'commentsEnabled', data) + + data.defaultValue = null + return utils.queryInterface.changeColumn('video', 'commentsEnabled', data) +} + +function down (options) { + throw new Error('Not implemented.') +} + +export { + up, + down +} -- cgit v1.2.3