/* indent size: 2 */ // eslint-disable-next-line strict module.exports = app => { const DataTypes = app.Sequelize; const Model = app.model.define('PartnerInfo', { id: { type: DataTypes.INTEGER(10).UNSIGNED, allowNull: false, primaryKey: true, autoIncrement: true, }, name: { type: DataTypes.STRING(16), allowNull: true, }, address: { type: DataTypes.STRING(128), allowNull: true, }, tel_num: { type: DataTypes.STRING(16), allowNull: true, }, opening_time: { type: DataTypes.STRING(64), allowNull: true, }, rate_from_partner: { type: DataTypes.FLOAT(10, 2), allowNull: true, }, rate_default: { type: DataTypes.FLOAT(10, 2), allowNull: true, }, user_id: { type: DataTypes.INTEGER(16).UNSIGNED, allowNull: true, }, create_time: { type: DataTypes.TIME, allowNull: true, }, update_time: { type: DataTypes.TIME, allowNull: true, }, partner_img: { type: DataTypes.STRING(128), allowNull: true, }, county_name: { type: DataTypes.STRING(16), allowNull: true, }, router_name: { type: DataTypes.STRING(32), allowNull: true, }, top: { type: DataTypes.INTEGER(1).UNSIGNED, allowNull: true, }, online: { type: DataTypes.INTEGER(1).UNSIGNED, allowNull: true, }, order_amount: { type: DataTypes.INTEGER(8).UNSIGNED, allowNull: true, }, latitude: { type: DataTypes.FLOAT(10, 6), allowNull: true, }, longitude: { type: DataTypes.FLOAT(11, 6), allowNull: true, }, category_id: { type: DataTypes.INTEGER(10), allowNull: true, }, partner_fees: { type: DataTypes.INTEGER(10), allowNull: true, }, }, { tableName: 'szj_partner_info', }); Model.associate = function() { // 关联用户表 Model.belongsTo(app.model.Users, { foreignKey: 'user_id', targetKey: 'user_id', as: 'user' }); }; // 同步:没有就新建,有就不变 Model.sync(); return Model; };