const Sequelize = require('sequelize'); module.exports = function(sequelize, DataTypes) { return sequelize.define('locations', { 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 }, location_type: { type: DataTypes.STRING(100), allowNull: true, comment: "TopPlaces; Shops; Places; NearbyCategories;" }, category: { type: DataTypes.STRING(100), allowNull: true }, category_name: { type: DataTypes.STRING(100), allowNull: true }, id: { type: DataTypes.STRING(100), allowNull: true }, name: { type: DataTypes.STRING(1000), allowNull: true }, distance: { type: DataTypes.FLOAT, allowNull: true, comment: "距离(km)" }, latitude: { type: DataTypes.DOUBLE, allowNull: true }, longitude: { type: DataTypes.DOUBLE, allowNull: true }, type_name: { type: DataTypes.STRING(100), allowNull: true }, type_id: { type: DataTypes.STRING(100), allowNull: true }, min_distance: { type: DataTypes.FLOAT, allowNull: true } }, { sequelize, tableName: 'locations', timestamps: false, indexes: [ { name: "PRIMARY", unique: true, using: "BTREE", fields: [ { name: "sn" }, ] }, { name: "locations_hotel_id_IDX", using: "BTREE", fields: [ { name: "hotel_id" }, ] }, ] }); };