sequelize/cli

sequelize.import is deprecated and still used in the generated code by the cli

yahyanouali opened this issue · 3 comments

In the sequelize manual it's marked that sequelize.import is deprecated and we should use just require instead : https://sequelize.org/master/manual/models-definition.html

But the code generated by sequelize-cli is still using it :

fs.readdirSync(__dirname)`
  .filter((file) => {
    return (
      file.indexOf(".") !== 0 && file !== basename && file.slice(-3) === ".js"
    );
  })
  .forEach((file) => {
    const model = sequelize["import"](path.join(__dirname, file));
    db[model.name] = model;
  });

Dialect: any
Database version: all
Sequelize CLI version: all
Sequelize version: all

papb commented

This is awful. Thanks for the report.

papb commented

For now this means that the CLI is not compatible with sequelize@next yes. Users of CLI will have to stick with v5 for now. Rest assured that v6 will not leave beta without this issue fixed.