1 import * as Sequelize from 'sequelize'
3 async function up (utils: {
4 transaction: Sequelize.Transaction
5 queryInterface: Sequelize.QueryInterface
6 sequelize: Sequelize.Sequelize
11 type: Sequelize.STRING,
16 await utils.queryInterface.addColumn('videoCaption', 'filename', data)
20 const query = `UPDATE "videoCaption" SET "filename" = s.uuid || '-' || s.language || '.vtt' ` +
22 ` SELECT "videoCaption"."id", video.uuid, "videoCaption".language ` +
23 ` FROM "videoCaption" INNER JOIN video ON video.id = "videoCaption"."videoId"` +
25 `WHERE "videoCaption".id = s.id`
27 await utils.sequelize.query(query)
32 type: Sequelize.STRING,
37 await utils.queryInterface.changeColumn('videoCaption', 'filename', data)
41 function down (options) {
42 throw new Error('Not implemented.')