Skip to content

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

@yahyanouali

Description

@yahyanouali

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions