我试图在两个模型之间引用外键。\n但我收到此错误:
\n\nthrow new Error(this.name + '.hasMany called with something that\\'s not a subclass of Sequelize.Model');\n^
错误: user_relation.hasMany 调用的内容不是 Sequelize.Model 的子类
\n\nsquelize.js
\n\nconst Sequelize = require('sequelize');\nconst config = require('./default.config')\nconst sequelize = new Sequelize(config.database, config.user, config.password, {\n host: config.host,\n port: config.port,\n dialect: 'mysql',\n timezone: config.timezone,//\xe4\xb8\x9c\xe5\x85\xab\xe5\x8c\xba\n pool: {\n max: 5,\n min: 0,\n acquire: 30000,\n idle: 10000\n }\n});\n\nsequelize\n .sync()\n .then(err => {\n console.log('Connection has been established successfully.');\n })\n .catch(err => {\n console.error('Unable to connect to the database:', err);\n });\n\nmodule.exports …Run Code Online (Sandbox Code Playgroud)