/* indent size: 2 */ // eslint-disable-next-line strict module.exports = app => { const DataTypes = app.Sequelize; const Model = app.model.define('RelUserInviter', { id: { type: DataTypes.INTEGER(10).UNSIGNED, allowNull: false, primaryKey: true, autoIncrement: true, }, user_id: { type: DataTypes.INTEGER(10).UNSIGNED, allowNull: true, }, inviter_id: { type: DataTypes.INTEGER(10).UNSIGNED, allowNull: true, }, create_time: { type: DataTypes.TIME, allowNull: true, }, }, { tableName: 'szj_rel_user_inviter', }); Model.associate = function() { // 关联用户表 // Model.hasOne(app.model.Users, { foreignKey: 'user_id', targetKey: 'user_id', as: 'user' }); }; // 同步:没有就新建,有就不变 Model.sync(); return Model; };