diff options
Diffstat (limited to 'server/initializers/migrations/0155-video-comments-enabled.ts')
-rw-r--r-- | server/initializers/migrations/0155-video-comments-enabled.ts | 26 |
1 files changed, 26 insertions, 0 deletions
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 | } | ||