Please need your help . Why i got the strange error for String(150) in nickname object ?
const Sequelize = require('sequelize');
const devOptions = require('./../config/config').connectionConf.development;
const sequelize = new Sequelize(
devOptions.database,
devOptions.username,
devOptions.password,
{
host: devOptions.host,
dialect: devOptions.dialect
}
);
const User = sequelize.define('user', {
user_id: {
primaryKey:true,
type:sequelize.BIGINT,
allowNull:false
},
nickname: {
type:sequelize.STRING(150),
unique:true,
allowNull:false
},
email: {
type:sequelize.STRING(150),
unique:true,
allowNull:false
},
user_password: {
type:sequelize.STRING(150),
unique:true,
allowNull:false
},
created_at: {
type:sequelize.Date,
created_time:sequelize.NOW,
allowNull:false
},
updated_at: {
type:sequelize.Date,
allowNull:false
}
}, {});
TypeError: sequelize.STRING is not a function at Object. (E:\Projects\JavaScript\couponsystem\src\models\schema.js:21:22) at Module._compile (internal/modules/cjs/loader.js:688:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10) at Module.load (internal/modules/cjs/loader.js:598:32) at tryModuleLoad (internal/modules/cjs/loader.js:537:12) at Function.Module._load (internal/modules/cjs/loader.js:529:3) at Module.require (internal/modules/cjs/loader.js:636:17) at require (internal/modules/cjs/helpers.js:20:18) at Object. (E:\Projects\JavaScript\couponsystem\src\models\generator.js:1:78) at Module._compile (internal/modules/cjs/loader.js:688:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10) at Module.load (internal/modules/cjs/loader.js:598:32) at tryModuleLoad (internal/modules/cjs/loader.js:537:12) at Function.Module._load (internal/modules/cjs/loader.js:529:3) at Function.Module.runMain (internal/modules/cjs/loader.js:741:12) at startup (internal/bootstrap/node.js:285:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)