1 import * as Sequelize from 'sequelize'
3 async function up (utils: {
4 transaction: Sequelize.Transaction
5 queryInterface: Sequelize.QueryInterface
6 sequelize: Sequelize.Sequelize
10 for (const column of [ 'playlistUrl', 'segmentsSha256Url' ]) {
12 type: Sequelize.STRING,
17 await utils.queryInterface.changeColumn('videoStreamingPlaylist', column, data)
22 await utils.sequelize.query(
23 `UPDATE "videoStreamingPlaylist" SET "playlistUrl" = NULL, "segmentsSha256Url" = NULL ` +
24 `WHERE "videoId" IN (SELECT id FROM video WHERE remote IS FALSE)`
29 for (const column of [ 'playlistFilename', 'segmentsSha256Filename' ]) {
31 type: Sequelize.STRING,
36 await utils.queryInterface.addColumn('videoStreamingPlaylist', column, data)
41 await utils.sequelize.query(
42 `UPDATE "videoStreamingPlaylist" SET "playlistFilename" = 'master.m3u8', "segmentsSha256Filename" = 'segments-sha256.json'`
47 for (const column of [ 'playlistFilename', 'segmentsSha256Filename' ]) {
49 type: Sequelize.STRING,
54 await utils.queryInterface.changeColumn('videoStreamingPlaylist', column, data)
59 function down (options) {
60 throw new Error('Not implemented.')