慕勒332531
2020-07-28 10:49
import { Sequelize, Model } from 'sequelize' import sequelize from '..lib/db' import {config} from 'lin-mizar'; class Movie extends Model { } Movie.init( attributes: { id:{ type:Sequelize.INTEGER, primaryKey: true, autoIncrement: true, }, image:{ type:Sequelize.STRING(64), }, content: { type:Sequelize.STRING(300), allowNull: true, }, fav_nums:{ type:Sequelize.INTEGER, defaultValue: 0, }, titile:{ type:Sequelize.STRING(50), }, type: { type:Sequelize.INTEGER, }, status:{ type:Sequelize.INTEGER, }, }, options:{ tableName: 'movie', modelName: 'movie', paranoid: true, timestamps: true, createdAt: 'created_at', updatedAt: 'updated_at', deletedAt: 'deleted_at', sequelize, } ) export { Movie as MovieModel };
同学把我视频里的IDE智能感知当成语法来写了。attributes:这个是不用写出来的。下面的options:同理
你这里是中文逗号吧
还是报错,options:也没有自动生成
感谢老师,主要是模型这部分文档有点看不明白?
0到1快速构建自己的后台管理系统
21500 学习 · 145 问题
相似问题