collects.js 739 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* indent size: 2 */
  2. module.exports = app => {
  3. const DataTypes = app.Sequelize;
  4. const Model = app.model.define('Collects', {
  5. collect_id: {
  6. type: DataTypes.INTEGER(10).UNSIGNED,
  7. allowNull: false,
  8. primaryKey: true,
  9. autoIncrement: true
  10. },
  11. user_id: {
  12. type: DataTypes.INTEGER(10).UNSIGNED,
  13. allowNull: true
  14. },
  15. product_id: {
  16. type: DataTypes.INTEGER(10).UNSIGNED,
  17. allowNull: true
  18. },
  19. update_time: {
  20. type: DataTypes.TIME
  21. },
  22. create_time: {
  23. type: DataTypes.DATE,
  24. allowNull: false
  25. }
  26. }, {
  27. tableName: 'szj_collects'
  28. });
  29. Model.associate = function() {
  30. }
  31. //同步:没有就新建,有就不变
  32. Model.sync();
  33. return Model;
  34. };