const Sequelize = require('sequelize'); module.exports = function(sequelize, DataTypes) { return sequelize.define('hotelinfo', { hi_sn: { autoIncrement: true, type: DataTypes.BIGINT, allowNull: false, primaryKey: true }, hotel_id: { type: DataTypes.BIGINT, allowNull: false, unique: "hotelinfo_unique" }, hotel_name: { type: DataTypes.STRING(100), allowNull: true }, country_code: { type: DataTypes.STRING(10), allowNull: true }, city_id: { type: DataTypes.STRING(10), allowNull: true }, address: { type: DataTypes.STRING(1000), allowNull: true }, phone: { type: DataTypes.STRING(200), allowNull: true }, latitude: { type: DataTypes.STRING(100), allowNull: true }, longitude: { type: DataTypes.STRING(100), allowNull: true }, rating: { type: DataTypes.DECIMAL(4,1), allowNull: true }, hotel_type: { type: DataTypes.STRING(100), allowNull: true }, brand: { type: DataTypes.STRING(100), allowNull: true }, postal_code: { type: DataTypes.STRING(100), allowNull: true }, hero_img: { type: DataTypes.STRING(1000), allowNull: true }, supplier_type: { type: DataTypes.STRING(100), allowNull: true, comment: "酒店供应类型:SF(自签单体) null(普通) 默认是null" }, review_score: { type: DataTypes.FLOAT, allowNull: true }, review_count: { type: DataTypes.INTEGER, allowNull: true }, review_desc: { type: DataTypes.STRING(1000), allowNull: true }, location_poi_score: { type: DataTypes.FLOAT, allowNull: true }, location_airport_score: { type: DataTypes.FLOAT, allowNull: true }, location_transportation_score: { type: DataTypes.FLOAT, allowNull: true }, last_modify_time: { type: DataTypes.DATE, allowNull: true, defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP') } }, { sequelize, tableName: 'hotelinfo', timestamps: false, indexes: [ { name: "PRIMARY", unique: true, using: "BTREE", fields: [ { name: "hi_sn" }, ] }, { name: "hotelinfo_unique", unique: true, using: "BTREE", fields: [ { name: "hotel_id" }, ] }, { name: "hotelinfo_hotel_id_IDX", using: "BTREE", fields: [ { name: "hotel_id" }, ] }, ] }); };