]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/initializers/migrations/0155-video-comments-enabled.ts
Try to fix video duplication
[github/Chocobozzz/PeerTube.git] / server / initializers / migrations / 0155-video-comments-enabled.ts
CommitLineData
47564bbe 1import * as Sequelize from 'sequelize'
c1e791ba 2import { Migration } from '../../models/migrations'
47564bbe
C
3
4async function up (utils: {
5 transaction: Sequelize.Transaction,
6 queryInterface: Sequelize.QueryInterface,
7 sequelize: Sequelize.Sequelize
8}): Promise<void> {
9 const data = {
10 type: Sequelize.BOOLEAN,
11 allowNull: false,
12 defaultValue: true
c1e791ba 13 } as Migration.Boolean
47564bbe
C
14 await utils.queryInterface.addColumn('video', 'commentsEnabled', data)
15
16 data.defaultValue = null
17 return utils.queryInterface.changeColumn('video', 'commentsEnabled', data)
18}
19
20function down (options) {
21 throw new Error('Not implemented.')
22}
23
24export {
25 up,
26 down
27}