Fix migration 200

pull/447/head
Chocobozzz 2018-03-30 17:47:21 +02:00
parent d788291d2a
commit 79d28db3f9
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 11 additions and 1 deletions

View File

@ -9,7 +9,7 @@ async function up (utils: {
{
const data = {
type: Sequelize.DATE,
allowNull: false,
allowNull: true,
defaultValue: Sequelize.NOW
}
await utils.queryInterface.addColumn('video', 'publishedAt', data)
@ -20,6 +20,16 @@ async function up (utils: {
await utils.sequelize.query(query)
}
// Sequelize does not alter the column with NOW as default value
{
const data = {
type: Sequelize.DATE,
allowNull: false,
defaultValue: Sequelize.NOW
}
await utils.queryInterface.changeColumn('video', 'publishedAt', data)
}
}
function down (options) {