const Sequelize = require('sequelize'); module.exports = function(sequelize, DataTypes) { return sequelize.define('reviews', { sn: { autoIncrement: true, type: DataTypes.BIGINT, allowNull: false, primaryKey: true }, hotel_id: { type: DataTypes.BIGINT, allowNull: false }, lgc: { type: DataTypes.TINYINT, allowNull: false }, locale: { type: DataTypes.STRING(100), allowNull: true }, type: { type: DataTypes.STRING(100), allowNull: true, comment: "ScoreDetails; Summaries; PositiveMentions" }, name: { type: DataTypes.STRING(100), allowNull: true }, category: { type: DataTypes.STRING(100), allowNull: true, comment: "种类 cleanliness(环境和清洁度) facilities(设施) location(位置) roomComfort(客房舒适度) staffPerformance(服务)valueForMoney(性价比)" }, score: { type: DataTypes.FLOAT, allowNull: true }, city_average: { type: DataTypes.FLOAT, allowNull: true }, mention_name: { type: DataTypes.STRING(100), allowNull: true }, mention_count: { type: DataTypes.INTEGER, allowNull: true } }, { sequelize, tableName: 'reviews', timestamps: false, indexes: [ { name: "PRIMARY", unique: true, using: "BTREE", fields: [ { name: "sn" }, ] }, { name: "reviews_hotel_id_IDX", using: "BTREE", fields: [ { name: "hotel_id" }, ] }, ] }); };