/* indent size: 2 */ module.exports = app => { const DataTypes = app.Sequelize; const Model = app.model.define('OrdersAction', { action_id: { type: DataTypes.INTEGER(10).UNSIGNED, allowNull: false, primaryKey: true, autoIncrement: true }, admin_id: { type: DataTypes.INTEGER(10).UNSIGNED, allowNull: true }, order_id: { type: DataTypes.INTEGER(10).UNSIGNED, allowNull: true }, action_desc: { type: DataTypes.STRING(255), allowNull: true }, update_time: { type: DataTypes.TIME, allowNull: true }, create_time: { type: DataTypes.DATE, allowNull: true } }, { tableName: 'szj_orders_action' }); Model.associate = function() { //关联管理员表 Model.belongsTo(app.model.AdminUser,{foreignKey:'admin_id',targetKey:'admin_id',as:'admin_user'}); } //同步:没有就新建,有就不变 Model.sync(); return Model; };