Answer the question
In order to leave comments, you need to log in
TypeError: sequelize.import is not a function?
The code:
const Sequelize = require('sequelize');
const sequelize = new Sequelize('database', 'username', 'password', {
host: 'localhost',
dialect: 'sqlite',
logging: false,
storage: 'database.sqlite',
});
const CurrencyShop = sequelize.import('models/CurrencyShop');
const Users = sequelize.import('models/Users');
const UserItems = sequelize.import('models/UserItems');
TypeError: sequelize.import is not a function
Answer the question
In order to leave comments, you need to log in
xs. as there is not enough input data, read the doc, there is a lot of things written there
Yes, indeed, in the 6th version, .import was removed.
Rewrote it:
let model = sequelize.import(path.join(modelsPath, file))
let model = require(path.join(modelsPath, file))(sequelize, Sequelize.DataTypes)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question