/* indent size: 2 */ // eslint-disable-next-line strict module.exports = app => { const DataTypes = app.Sequelize; const Model = app.model.define('DinnerCoins', { id: { type: DataTypes.INTEGER(10).UNSIGNED, allowNull: false, primaryKey: true, autoIncrement: true, }, user_id: { type: DataTypes.INTEGER(16), allowNull: true, }, account: { type: DataTypes.FLOAT(10, 2), allowNull: true, }, ori_partner: { type: DataTypes.INTEGER(1), allowNull: true, }, expired: { type: DataTypes.INTEGER(1), allowNull: true, }, partner_id: { type: DataTypes.INTEGER(16), allowNull: true, }, partner_name: { type: DataTypes.STRING(64), allowNull: true, }, partner_address: { type: DataTypes.STRING(128), allowNull: true, }, partner_tel: { type: DataTypes.STRING(16), allowNull: true, }, partner_opening_time: { type: DataTypes.STRING(64), allowNull: true, }, expired_time: { type: DataTypes.TIME, allowNull: true, }, create_time: { type: DataTypes.TIME, allowNull: true, }, update_time: { type: DataTypes.TIME, allowNull: true, }, }, { tableName: 'szj_dinner_coins', }); Model.associate = function() { // 关联用户表 // Model.belongsTo(app.model.Users, { foreignKey: 'user_id', targetKey: 'user_id', as: 'user' }); }; // 同步:没有就新建,有就不变 Model.sync(); return Model; };