1 import * as Sequelize from 'sequelize'
3 async function up (utils: {
4 transaction: Sequelize.Transaction,
5 queryInterface: Sequelize.QueryInterface,
6 sequelize: Sequelize.Sequelize
13 defaultValue: Sequelize.NOW
15 await utils.queryInterface.addColumn('video', 'publishedAt', data)
19 const query = 'UPDATE video SET "publishedAt" = video."createdAt"'
20 await utils.sequelize.query(query)
23 // Sequelize does not alter the column with NOW as default value
28 defaultValue: Sequelize.NOW
30 await utils.queryInterface.changeColumn('video', 'publishedAt', data)
35 function down (options) {
36 throw new Error('Not implemented.')