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:也没有自动生成
感谢老师,主要是模型这部分文档有点看不明白?