orders_action.js 978 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* indent size: 2 */
  2. module.exports = app => {
  3. const DataTypes = app.Sequelize;
  4. const Model = app.model.define('OrdersAction', {
  5. action_id: {
  6. type: DataTypes.INTEGER(10).UNSIGNED,
  7. allowNull: false,
  8. primaryKey: true,
  9. autoIncrement: true
  10. },
  11. admin_id: {
  12. type: DataTypes.INTEGER(10).UNSIGNED,
  13. allowNull: true
  14. },
  15. order_id: {
  16. type: DataTypes.INTEGER(10).UNSIGNED,
  17. allowNull: true
  18. },
  19. action_desc: {
  20. type: DataTypes.STRING(255),
  21. allowNull: true
  22. },
  23. update_time: {
  24. type: DataTypes.TIME,
  25. allowNull: true
  26. },
  27. create_time: {
  28. type: DataTypes.DATE,
  29. allowNull: true
  30. }
  31. }, {
  32. tableName: 'szj_orders_action'
  33. });
  34. Model.associate = function() {
  35. //关联管理员表
  36. Model.belongsTo(app.model.AdminUser,{foreignKey:'admin_id',targetKey:'admin_id',as:'admin_user'});
  37. }
  38. //同步:没有就新建,有就不变
  39. Model.sync();
  40. return Model;
  41. };