const Sequelize = require('sequelize'); module.exports = function(sequelize, DataTypes) { return sequelize.define('rooms', { 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 }, room_id: { type: DataTypes.STRING(100), allowNull: false }, room_name: { type: DataTypes.STRING(500), allowNull: true }, locale_name: { type: DataTypes.STRING(500), allowNull: true }, bed_type_desc: { type: DataTypes.STRING(1000), allowNull: true }, area: { type: DataTypes.STRING(100), allowNull: true }, views: { type: DataTypes.STRING(100), allowNull: true }, window: { type: DataTypes.INTEGER, allowNull: true, comment: "窗户信息 0未知 1有窗 2无窗 3部分有窗 4内窗 5封闭窗 6部分内窗" }, floor: { type: DataTypes.STRING(100), allowNull: true }, wireless_wideband: { type: DataTypes.INTEGER, allowNull: true, comment: "无线网络信息 0未知 1无 2免费 3收费 4部分收费 5部分有且收费 6部分有且免费" }, wired_broadband: { type: DataTypes.INTEGER, allowNull: true, comment: "有线网络信息 0未知 1无 2免费 3收费 4部分收费 5部分有且收费 6部分有且免费" }, smoking: { type: DataTypes.INTEGER, allowNull: true, comment: "吸烟信息 0未知 1禁烟 2部分禁烟 3可吸烟" }, bathroom_type: { type: DataTypes.INTEGER, allowNull: true, comment: "卫浴信息 0未知 1独立卫浴 2公共卫浴" }, max_occupancy: { type: DataTypes.JSON, allowNull: true }, bedrooms: { type: DataTypes.JSON, allowNull: true } }, { sequelize, tableName: 'rooms', timestamps: false, indexes: [ { name: "PRIMARY", unique: true, using: "BTREE", fields: [ { name: "sn" }, ] }, { name: "rooms_room_id_IDX", using: "BTREE", fields: [ { name: "room_id" }, ] }, { name: "rooms_hotel_id_IDX", using: "BTREE", fields: [ { name: "hotel_id" }, ] }, ] }); };