error details
== 20180828102922-add-sponsor-intro-to-lotteries: migrating =======
ERROR: Error: Migration 20180828102922-add-sponsor-intro-to-lotteries.js (or wrapper) didn't return a promise
at /Users/greatghoul/Workspace/Miidii/Sweetfoot/node_modules/umzug/lib/migration.js:132:15
at Generator.next (<anonymous>)
at step (/Users/greatghoul/Workspace/Miidii/Sweetfoot/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
at /Users/greatghoul/Workspace/Miidii/Sweetfoot/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13
at process._tickCallback (internal/process/next_tick.js:68:7)
migration file
'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
return [
queryInterface.addColumn('Lotteries', 'sponsor_intro', {
type: Sequelize.TEXT,
allowNull: true,
}),
queryInterface.addColumn('Lotteries', 'prefs', {
type: Sequelize.JSONB,
allowNull: false,
defaultValue: {},
}),
queryInterface.addColumn('Lotteries', 'award_usage', {
type: Sequelize.TEXT,
allowNull: true,
}),
queryInterface.addColumn('Lotteries', 'award_price', {
type: Sequelize.STRING,
allowNull: true,
}),
];
},
down: (queryInterface, Sequelize) => {
return [
queryInterface.removeColumn('Lotteries', 'sponsor_intro'),
queryInterface.removeColumn('Lotteries', 'prefs'),
queryInterface.removeColumn('Lotteries', 'award_usage'),
queryInterface.removeColumn('Lotteries', 'award_price'),
];
}
};
Was an easy fix for me to just change
return [
toreturn Promise.all([
and ending])
Should probably have been a Major semver update as it’s a breaking change?I vote for the array support.
@thutv18 You could easily fix your migration by wrapping it in a
Promise.all
Egreturn Promise.all([ queryInterface.addColumn ... ])
After reinstalling version
sequelize 4.36.1
&sequelize-cli 4.0.0
then running migrations locally I came across this issue. It would be useful to know whether there is a way to revert back to how it was before this change was implemented. Are there any release notes on this?Ran into this today as well…
Question is: do we wanna keep the array support or are we dropping it?
@samathan you should change it to
I locked umzug to
2.1.0
.I guess it should be using Promise instead of Array.