Fix migration 200
This commit is contained in:
parent
d788291d2a
commit
79d28db3f9
|
@ -9,7 +9,7 @@ async function up (utils: {
|
||||||
{
|
{
|
||||||
const data = {
|
const data = {
|
||||||
type: Sequelize.DATE,
|
type: Sequelize.DATE,
|
||||||
allowNull: false,
|
allowNull: true,
|
||||||
defaultValue: Sequelize.NOW
|
defaultValue: Sequelize.NOW
|
||||||
}
|
}
|
||||||
await utils.queryInterface.addColumn('video', 'publishedAt', data)
|
await utils.queryInterface.addColumn('video', 'publishedAt', data)
|
||||||
|
@ -20,6 +20,16 @@ async function up (utils: {
|
||||||
await utils.sequelize.query(query)
|
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) {
|
function down (options) {
|
||||||
|
|
Loading…
Reference in New Issue