when I am run this code it showing error Invalid umzug storage. the code are given bellow:
const { Umzug } = require('umzug');
const db = require('../../storage/models');
const umzug = new Umzug({
storage: 'Sequelize',
storageOptions: {
sequelize: db.sequelize, // here should be a sequelize instance, not the Sequelize module
modelName: 'SequelizeMeta',
columnName: 'name'
},
migrations: {
path: '../../storage/models'
},
logger: console,
});
exports.dbmigrate = async (req, res, next) => {
const executed = await umzug.executed();
res.send(executed);
};
Updated Umzug migration tool has some changes in the syntax. I have modified the code you posted. Please try with this code. It should work. Reference Link: Docs