1 import * as Sequelize from 'sequelize'
2 import { CONSTRAINTS_FIELDS } from '../constants'
4 async function up (utils: {
5 transaction: Sequelize.Transaction,
6 queryInterface: Sequelize.QueryInterface,
7 sequelize: Sequelize.Sequelize
11 await utils.queryInterface.renameColumn('video', 'language', 'oldLanguage')
16 type: Sequelize.STRING(CONSTRAINTS_FIELDS.VIDEOS.LANGUAGE.max),
20 await utils.queryInterface.addColumn('video', 'language', data)
143 for (const language of languages) {
144 const query = 'UPDATE "video" SET "language" = \'' + language.newLanguage + '\' WHERE "oldLanguage" = ' + language.oldLanguage
145 await utils.sequelize.query(query)
150 await utils.queryInterface.removeColumn('video', 'oldLanguage')
155 function down (options) {
156 throw new Error('Not implemented.')