diff options
author | Chocobozzz <me@florianbigard.com> | 2018-01-03 10:12:36 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-01-03 10:38:19 +0100 |
commit | 47564bbe2eeb2baae9b7e3f9b2b8d16522bc7e04 (patch) | |
tree | 25e2836baf3dfce6f422192d98332db1bfe65890 /server/initializers | |
parent | c5911fd347c76e8bdc05ea9f3ee9efed4a58c236 (diff) | |
download | PeerTube-47564bbe2eeb2baae9b7e3f9b2b8d16522bc7e04.tar.gz PeerTube-47564bbe2eeb2baae9b7e3f9b2b8d16522bc7e04.tar.zst PeerTube-47564bbe2eeb2baae9b7e3f9b2b8d16522bc7e04.zip |
Add ability to disable video comments
Diffstat (limited to 'server/initializers')
-rw-r--r-- | server/initializers/constants.ts | 2 | ||||
-rw-r--r-- | server/initializers/migrations/0155-video-comments-enabled.ts | 26 |
2 files changed, 27 insertions, 1 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 50a29dc43..31bb6c981 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -9,7 +9,7 @@ import { isTestInstance, root, sanitizeHost, sanitizeUrl } from '../helpers/core | |||
9 | 9 | ||
10 | // --------------------------------------------------------------------------- | 10 | // --------------------------------------------------------------------------- |
11 | 11 | ||
12 | const LAST_MIGRATION_VERSION = 150 | 12 | const LAST_MIGRATION_VERSION = 155 |
13 | 13 | ||
14 | // --------------------------------------------------------------------------- | 14 | // --------------------------------------------------------------------------- |
15 | 15 | ||
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 @@ | |||
1 | import * as Sequelize from 'sequelize' | ||
2 | |||
3 | async function up (utils: { | ||
4 | transaction: Sequelize.Transaction, | ||
5 | queryInterface: Sequelize.QueryInterface, | ||
6 | sequelize: Sequelize.Sequelize | ||
7 | }): Promise<void> { | ||
8 | const data = { | ||
9 | type: Sequelize.BOOLEAN, | ||
10 | allowNull: false, | ||
11 | defaultValue: true | ||
12 | } | ||
13 | await utils.queryInterface.addColumn('video', 'commentsEnabled', data) | ||
14 | |||
15 | data.defaultValue = null | ||
16 | return utils.queryInterface.changeColumn('video', 'commentsEnabled', data) | ||
17 | } | ||
18 | |||
19 | function down (options) { | ||
20 | throw new Error('Not implemented.') | ||
21 | } | ||
22 | |||
23 | export { | ||
24 | up, | ||
25 | down | ||
26 | } | ||