1 import * as Sequelize from 'sequelize'
3 async function up (utils: {
4 transaction: Sequelize.Transaction
5 queryInterface: Sequelize.QueryInterface
6 sequelize: Sequelize.Sequelize
9 // We made a mistake with the migration in 2.2.0-rc.1
10 // Docker containers did not include this migration file
11 // So we check the table definition and add the column if it does not exist
12 const tableDefinition = await utils.queryInterface.describeTable('videoFile')
14 if (!tableDefinition['metadata']) {
16 type: Sequelize.JSONB,
19 await utils.queryInterface.addColumn('videoFile', 'metadata', metadata)
22 if (!tableDefinition['metadataUrl']) {
24 type: Sequelize.STRING,
27 await utils.queryInterface.addColumn('videoFile', 'metadataUrl', metadataUrl)
31 function down (options) {
32 throw new Error('Not implemented.')